Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
85938b47
Unverified
Commit
85938b47
authored
Jul 15, 2025
by
Boris Yumankulov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: Added org.freedesktop.ScreenSaver.SimulateUserActivity for flatpak support
Signed-off-by:
Boris Yumankulov
<
boria138@altlinux.org
>
parent
f0265a80
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
7 deletions
+36
-7
functions_helper
data_from_portwine/scripts/functions_helper
+36
-7
No files found.
data_from_portwine/scripts/functions_helper
View file @
85938b47
...
@@ -135,6 +135,33 @@ fatal () {
...
@@ -135,6 +135,33 @@ fatal () {
exit
1
exit
1
}
}
simulate_user_activity
()
{
dbus-send
--session
--dest
=
org.freedesktop.ScreenSaver
\
--type
=
method_call /org/freedesktop/ScreenSaver
\
org.freedesktop.ScreenSaver.SimulateUserActivity
}
start_activity_simulation
()
{
(
trap
'exit 0'
TERM INT
while
[
-f
"
${
PORT_WINE_PATH
}
/data/tmp/screensaver_pid"
]
;
do
simulate_user_activity
sleep
30
done
)
&
echo
$!
>
"
${
PORT_WINE_PATH
}
/data/tmp/screensaver_pid"
}
stop_activity_simulation
()
{
if
[
-f
"
${
PORT_WINE_PATH
}
/data/tmp/screensaver_pid"
]
;
then
pw_screensaver_pid
=
$(
cat
"
${
PORT_WINE_PATH
}
/data/tmp/screensaver_pid"
)
if
ps cax |
grep
"
${
pw_screensaver_pid
}
"
;
then
kill
-n
9
"
${
pw_screensaver_pid
}
"
&>/dev/null
fi
rm
-f
"
${
PORT_WINE_PATH
}
/data/tmp/screensaver_pid"
fi
}
change_locale
()
{
change_locale
()
{
if
[[
-f
"
${
PORT_WINE_TMP_PATH
}
/PortProton_loc"
]]
;
then
if
[[
-f
"
${
PORT_WINE_TMP_PATH
}
/PortProton_loc"
]]
;
then
LANGUAGE
=
$(
<
"
${
PORT_WINE_TMP_PATH
}
/PortProton_loc"
)
LANGUAGE
=
$(
<
"
${
PORT_WINE_TMP_PATH
}
/PortProton_loc"
)
...
@@ -2031,7 +2058,6 @@ stop_portwine () {
...
@@ -2031,7 +2058,6 @@ stop_portwine () {
dbus-send
--session
--dest
=
com.deepin.WMSwitcher
--type
=
method_call /com/deepin/WMSwitcher com.deepin.WMSwitcher.RequestSwitchWM
dbus-send
--session
--dest
=
com.deepin.WMSwitcher
--type
=
method_call /com/deepin/WMSwitcher com.deepin.WMSwitcher.RequestSwitchWM
fi
fi
fi
fi
pw_stop_progress_bar
pw_stop_progress_bar
try_remove_file
"
${
PORT_SCRIPTS_PATH
}
/0"
try_remove_file
"
${
PORT_SCRIPTS_PATH
}
/0"
try_remove_file
"
${
PORT_SCRIPTS_PATH
}
/1"
try_remove_file
"
${
PORT_SCRIPTS_PATH
}
/1"
...
@@ -2040,6 +2066,7 @@ stop_portwine () {
...
@@ -2040,6 +2066,7 @@ stop_portwine () {
find
"
${
PORT_WINE_PATH
}
/data/prefixes/
${
PW_PREFIX_NAME
}
/drive_c/"
-maxdepth
1
-type
f
-name
"*.tmp"
-delete
find
"
${
PORT_WINE_PATH
}
/data/prefixes/
${
PW_PREFIX_NAME
}
/drive_c/"
-maxdepth
1
-type
f
-name
"*.tmp"
-delete
pw_exit_tray
pw_exit_tray
pw_auto_create_shortcut
pw_auto_create_shortcut
stop_activity_simulation
add_in_stop_portwine
add_in_stop_portwine
if
[[
$PW_LOG
!=
1
]]
&&
[[
-n
$START_PW_TIME_IN_GAME
]]
;
then
if
[[
$PW_LOG
!=
1
]]
&&
[[
-n
$START_PW_TIME_IN_GAME
]]
;
then
...
@@ -3644,14 +3671,16 @@ start_portwine () {
...
@@ -3644,14 +3671,16 @@ start_portwine () {
export
PW_GAMEMODERUN_SLR
=
""
export
PW_GAMEMODERUN_SLR
=
""
fi
fi
# TODO: Add org.freedesktop.ScreenSaver.SimulateUserActivity for Flatpak support
if
[[
"
$GAMEMODERUN
"
!=
"1"
]]
;
then
# org.freedesktop.ScreenSaver.Inhibit doesn`t work because the Inhibit method is released as soon as the D-Bus connection is released
if
check_flatpak
;
then
if
command
-v
systemd-inhibit &>/dev/null
\
start_activity_simulation
&&
[[
"
$GAMEMODERUN
"
!=
"1"
]]
PW_INHIBIT_SLR
=
""
then
print_info
"Screensaver will be inhibited using D-Bus (Flatpak mode)"
elif
command
-v
systemd-inhibit &>/dev/null
;
then
PW_INHIBIT_SLR
=
"systemd-inhibit --mode=block --who=ru.linux_gaming.PortProton --why=
${
translations
[Launched]
}
--what=idle:sleep"
PW_INHIBIT_SLR
=
"systemd-inhibit --mode=block --who=ru.linux_gaming.PortProton --why=
${
translations
[Launched]
}
--what=idle:sleep"
print_info
"Screensaver will be inhibit"
print_info
"Screensaver will be inhibit
ed using systemd-inhibit (Native mode)
"
fi
fi
fi
pw_other_fixes
pw_other_fixes
# enabled BattleEye_Runtime and EasyAntiCheat_Runtime
# enabled BattleEye_Runtime and EasyAntiCheat_Runtime
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment