SUMMARY *** Idle Script in settings of Power Management is separated from Idle Inhibit, which makes impossible wljoywake and caffeine to create screensaver inhibited by joystick *** STEPS TO REPRODUCE 1. Setup wljoywake or caffeine to inhibit idle 2. Set Idle Script to Screensaver under Wine 3. Script Inhibit does not work! OBSERVED RESULT Screensaver on wine still running on Screen Inhibit, which is "undefined behavior" EXPECTED RESULT Idle Script should be inhibited by programs SOFTWARE/OS VERSIONS Linux/KDE Plasma: CachyOS (Arch Linux) (available in About System) KDE Plasma Version: 5.27.6 KDE Frameworks Version: 5.108.0 Qt Version: 5.15.10
> 2. Set Idle Script to Screensaver under Wine What you you mean with this?
(In reply to Nicolas Fella from comment #1) > > 2. Set Idle Script to Screensaver under Wine > > What you you mean with this? Oh, sorry. I'm using Windows Screensaver in Wine, such as fancy Dream Aquarium
(In reply to Nicolas Fella from comment #1) > > 2. Set Idle Script to Screensaver under Wine > > What you you mean with this? I wrote simple script for launching Windows screensaver with Wine. But, it triggers when screensaver of KDE (screen locker, screen sleep) inhibited by other programs, such as Caffeine or wljoywake There is no way to prevent script from triggering, while screensaver inhibited by programs or D-Bus
Not sure how wljoywake or caffeine inhibit idle, but Bug 457859 (systemd-inhibit is not respected) seems like a related issue.
*** This bug has been marked as a duplicate of bug 457859 ***
Reopening as "not a duplicate". I haven't gotten around to testing custom script idle behavior, but this is different to Bug 457859 which is not at all about custom scripts and just talks about preventing regular suspend actions.
I found another app that has the same problem. https://github.com/rafaelrc7/wayland-pipewire-idle-inhibit/issues/1
Regarding `wljoywake` and `wayland-pipewire-idle-inhibit`, it seems that KDE is implementing the `zwp_idle_inhibit_manager_v1` protocol correctly. It's other compositors that implement incorrectly, and these apps that rely on incorrect behavior. See https://github.com/swaywm/sway/issues/8080, and https://codeberg.org/river/river/issues/1079#issuecomment-2013817. (So, I guess that this issue report is a https://xkcd.com/1172/ situation.) Caffeine (not -ng) is another situation, since it uses `xdg-screensaver`. https://bugs.kde.org/show_bug.cgi?id=383575#c4
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/305
So in Comment #8, we have an explanation for * why wljoywake won't work: it uses zwp_idle_inhibit_manager_v1 but doesn't have a Wayland surface with focus to keep inhibiting, and * why caffeine (not -ng) doesn't work: it uses xdg-screensaver, which can't work because it places incorrect assumptions on the old `org.freedesktop.ScreenSaver` interface. That seems like a good reason to close this bug report. For an inhibit method that works, consider `systemd-inhibit --what=idle`, or caffeine-ng, or anything that uses one of the inhibition D-Bus APIs correctly: `org.freedesktop.portal.Inhibit` (to be fixed by the MR above, hopefully in Plasma 6.1.4), `org.freedesktop.login1`, `org.freedesktop.PowerManagement.Inhibit`, `org.freedesktop.ScreenSaver`.
Git commit 1549c49f41f544cb9dad54de509f318cc5b6dc38 by Jakob Petsovits. Committed on 30/07/2024 at 11:20. Pushed by jpetso into branch 'master'. Inhibit: Forward the correct inhibition flags to PolicyAgent The Inhibit method ignored the value of the "flags" argument and always sent InterruptSession as inhibition policy. This prevents sleep, but does not prevent idle actions such as screen locking and dimming. This commit changes the requested inhibition policies to match the documented values for "flags": * Portals "Suspend" remains PolicyAgent "InterruptSession". * Portals "Idle" becomes PolicyAgent "ChangeScreenSettings". * Portals "Logout" and "User Switch" are not supported at this time and are merely logged but otherwise ignored. PowerDevil, which implements the PolicyAgent API, uses the same policies also to represent the logind "sleep" and "idle" inhibitors, so we can trust that they behave accordingly. Related: bug 486506, bug 335729 M +12 -2 src/inhibit.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/1549c49f41f544cb9dad54de509f318cc5b6dc38
A possibly relevant merge request was started @ https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/306
Git commit 8fd86c5b0e6d6797bff850947b07e086544cd617 by Jakob Petsovits. Committed on 31/07/2024 at 10:37. Pushed by jpetso into branch 'Plasma/6.1'. Inhibit: Forward the correct inhibition flags to PolicyAgent The Inhibit method ignored the value of the "flags" argument and always sent InterruptSession as inhibition policy. This prevents sleep, but does not prevent idle actions such as screen locking and dimming. This commit changes the requested inhibition policies to match the documented values for "flags": * Portals "Suspend" remains PolicyAgent "InterruptSession". * Portals "Idle" becomes PolicyAgent "ChangeScreenSettings". * Portals "Logout" and "User Switch" are not supported at this time and are merely logged but otherwise ignored. PowerDevil, which implements the PolicyAgent API, uses the same policies also to represent the logind "sleep" and "idle" inhibitors, so we can trust that they behave accordingly. Related: bug 486506, bug 335729 (cherry picked from commit 1549c49f41f544cb9dad54de509f318cc5b6dc38) Co-authored-by: Jakob Petsovits <jpetso@petsovits.com> M +12 -2 src/inhibit.cpp https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/commit/8fd86c5b0e6d6797bff850947b07e086544cd617