eonpatapon / gnome-shell-extension-caffeine

Disable screensaver and auto suspend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

only apply to the active display

07416 opened this issue · comments

commented

If you have a multi-display setup, caffeine appears to keep all the screens awake. Can you add an option to only enable caffeine for the display(s) which are running a full-screen program or a 'trigger' application (settings → apps)?

For example, a media player running on the secondary display device (a TV or projector in my case) prevents my computer monitor from turning off and must be shut down manually (the display timeout has been set to five minutes in Gnome settings → power → screen blank).

I'm not sure this is possible? As far as I know, Caffeine prevents GNOME from suspending, but GNOME doesn't support suspending individual monitors, so Caffeine can't control this either.

I haven't done much with the inhibitor this extensions creates, so @pakaoraki or @eonpatapon might be able to help more.

It's not possible, we use org.gnome.SessionManager.Inhibit dbus method to add inhibitors to the session. The method takes flags to specify what should be inhibited and there is no such thing as letting a single monitor idle (go blank).

See https://github.com/GNOME/gnome-settings-daemon/blob/f8db0b179b5d151cb18438070e895ff682a29f4a/gnome-settings-daemon/org.gnome.SessionManager.xml#L102 for the list of flags

We use 8 + 4 (12):

  • 4: Inhibit suspending the session or computer
  • 8: Inhibit the session being marked as idle (<- I believe this one makes the screen(s) don't go blank on idle)

/* Inhibited flag value
* - 4: Inhibit suspending the session or computer
* - 12: Inhibit the session being marked as idle
*/
this.inhibitFlags= 12;

(note that the comment is incorrect :))