[vlc-devel] [PATCH] Add dpms module to switch it off while playing
funman at videolan.org
Fri Oct 25 21:20:44 CEST 2013
Le 25/10/2013 21:01, Olivier Brunel a écrit :
> On 10/25/13 20:51, Rémi Denis-Courmont wrote:
>> The DPMS extension of X11 is meant for the desktop power management component
>> to use, not for normal applications. Changing DPMS settings via xset, Xlib or
>> XCB would clobber the desktop settings, which is obviously *not* acceptable.
This is pretty much what xdg-screensaver does (see below).
>> Normally, the desktop should automatically disarm and rearm DPMS when the
>> screensaver is inhibited and uninhibited respectively. If it does not, then it
>> is a the bug in the desktop environment. There are no ways to fix this problem
>> in VLC for lack of a proper API.
> Well, as I said the right thing to do would have been to call
> xdg-screensaver, but for that I would have needed to send it the window
> ID, which I don't know how to get from VLC.
> And since (in my specific setup) that call would pretty much call xset,
> I did that directly.
Indeed, xdg-screensaver calls xset directly to change DPMS in each of
its modes (reset or suspend/resume).
Desktop power managers check DPMS setting regularly to see if they have
been changed and set them back to their desired value.
> If the window ID can be obtained, calling
> xdg-screensaver suspend/resume would be a better solution of course.
The DPMS code in xdg-screensaver doesn't use the window ID anyway (it
uses it for tracking the disappearance of the window) so I am not sure
if it is a better solution.
Because "xdg-screensaver reset" does not prevent DPMS from timing out,
the best solution IMO is to merge this code into modules/misc/inhibit/xdg.c
If the desktop environment has a power manager handling DPMS, it should
be handled by the dbus.c module which has higher priority.
If there's no such manager then we can disable DPMS with xset to be able
to watch movies without moving out of the couch every 10 minutes..
More information about the vlc-devel