Protocol for inhibiting idleness (temporarily disabling screensaver) with ability to blank uninhibited outputs/screens
Submitted by blitmap
Assigned to Bryce Harrington Harrington
Currently there is no way through xdg-shell for a surface to inhibit the screensaver/blanker/locker (an idleness inhibitor).
It's important that a surface be able to inhibit idleness only on the screen(s) it appears on, so that the compositor could blank other screens. The compositor can either avoid blanking all screens if any surface is inhibiting -or- just the screens that aren't inhibited. I think it's important that it be part of the protocol to associate the lock with a specific surface - as the compositor knows where the surface is, on which screen. The lock also needs to disappear if the surface disappears. I'm proposing this be part of xdg-shell because I think it would need to depend on the surface PONGing to keep the lock.
There is a dbus spec that jadahl on #wayland linked but I think it fails a few of this requirements, I am not sure - it needs review by someone more experienced than I :-)
From what was said I don't think it can inhibit idleness on a per-screen basis and tracking if the surface disappears is somewhat trickier. I put a log of the discussion about it below.
I have a few less important ideas for weston (and other compositors):
- config option (boolean): If a surface is inhibiting idleness don't blank that screen specifically but blank all others -- or don't blank any screens (traditional behavior).
- config option (boolean): Fullscreen surfaces automatically inhibit idleness (so the application doesn't have to know about this spec in transition).
- config option (boolean): Waking screens is done individually when that screen detects input, or all screens are woken at the same time (traditional behavior).
The IRC log about all this:
< Sleepy_User> hrrm. when running gnome-mplayer the screensaver/locker still triggers in weston - I was just wondering, is this something xwayland doesn't currently handle or is this something that someone would add to xdg-shell at another project to block the
< Sleepy_User> how are screensavers traditionally inhibited when you're watching a movie or playing something?
< pq> Sleepy_User, we have no protocol to inhibit screensavers yet.
< pq> I suppose that's on the TODO for after we have stabilized the first version of xdg-shell.
< Sleepy_User> pq: if you're not busy -- how would it work?
< Sleepy_User> I mean does the client inform the compositor it's doing something that shouldn't be covered/locked over, or does the compositor just "know" somehow from the type of application it is
< Sleepy_User> (like the .desktop files that provide information about what is installed)
< jadahl> why not just use dbus for that?
< jadahl> like http://people.freedesktop.org/~hadess/idle-inhibition-spec/re01.html
< pq> ah, if there is already a standard dbus interface for it and it is compatible with wayland, then sure.
< Sleepy_User> that seems cool :D
< pq> jadahl, just not sure how you'd associate the inhibit with a specific window, so that the compositor can clean up properly if the window gets destroyed.
< Sleepy_User> it'd be interesting if you had multiple monitors up to track which surface is on what screen inhibiting the idleness so you can lock/screensave the other screens
< Sleepy_User> configurable somewhere of course ~
< jadahl> pq: is it really necessary to bind it to awindow?
< pq> jadahl, it would allow nice things, like the automatic clean-up and what Sleepy_User said: blanking outputs where the window is not on.
< Sleepy_User> i am credit to team :D
< jadahl> isn't there automatic cleanup (if the application dies I mean)?
< pq> jadahl, no, if it only destroys that one window.
< pq> not disconnect
< pq> jadahl, actually, if you used dbus, can you even associate the inhibit to any connection either?
< jadahl> is it really worth writing protocol and having all toolkits etc support such a thing when the benefit is clients that forget to uninhibit?
< jadahl> skimming through some g-s-d code it looks like it handles the case where the application disappears at least
< pq> Correcting the forget to uninhibit is just a minor feat. Blanking other outputs seems like it might be worth it.
< jadahl> that sounds more like an extra feature to some set_fulscreen thing
< pq> I often run TV shows from my laptop to a real TV, and would be nice if the laptop screen could blank.
< jadahl> ah, you mean per-output-inhibit
< pq> yes
< pq> but automatic per-output, since the compositor knows where the window is
< jadahl> I usually use the blank-screen-button on the keyboard for that, but I suppose it'd be nice if it was automatic
< pq> jadahl, so how does a compositor associate a dbus connection to a Wayland connection?
< jadahl> pq: it doesn't. it looks if the "name" on dbus disappears and uninhibits that way
< pq> jadahl, so an app does not even need a window to be able to inhibit? Is that really ok?
< jadahl> pq: seems so
< pq> I have hunch we'll discuss that again after the more pressing matters are done.
< jadahl> yes, it doesn't feel very high up on the priority list