- Package:
- xscreensaver
- Source:
- xscreensaver
- Description:
- Screensaver daemon and frontend for X11
- Submitter:
- Michal Suchanek
- Date:
- 2013-12-28 19:57:14 UTC
- Severity:
- normal
Hello, I am using a media player (totem) that uses the dbus GnomeSession Inhibit call to disable screensaver. I wrote a GnomeSession implementation that calls xscreensaver-command -deactivate every time the Inhibit rpc is called and prints the time for debugging purpose. I set the blank interval to 10 min and dpms to 20 min. Screen is balnked although the Inhibit rpc is called about once every minute. the media player sometimes waits a bit more than one minute but definitely under two minutes. How I am supposed to disable the screensaver when the -deactivate command is ineffective? Attaching the GnomeSession implementation. Thanks Michal
If what you are trying to say is, "xscreensaver-command -deactivate doesn't work", you're wrong, and this is easy to demonstrate by just running it in a loop every couple minutes. Something else is going wrong with your script that is not the fault of xscreensaver.
If what you are trying to say is, "xscreensaver-command -deactivate doesn't work", you're wrong, and this is easy to demonstrate by just running it in a loop every couple minutes. Something else is going wrong with your script that is not the fault of xscreensaver.
And what that would be? I have the log of xscreensaver-command -deactivate being called within two minutes before the screen blanked. I unblank it and it's right there. Thanks Michal
And what that would be? I have the log of xscreensaver-command -deactivate being called within two minutes before the screen blanked. I unblank it and it's right there. Thanks Michal
Well, it does not. It deactivates the screensaver but does not prevent the DPMS blank so it's pretty much useless as running the script demostrates. Thanks Michal
Well, it does not. It deactivates the screensaver but does not prevent the DPMS blank so it's pretty much useless as running the script demostrates. Thanks Michal
It may very well be issue with the xscreensaver packaging in debian. It says that X11 screensaver extension is present but not compiled into xscreensaver. Extending the script to call not only xscreensaver but also the X11 Xss extension fixes the problem. I am not sure xscreensaver would try to use Xss in this case but since it is not complied in it's out of question anyway. Either way, xscreensaver-command -deactivate does not prevent screen from blanking so it does not perform as advertised and is undeniably broken even if you are saying it is not. Thanks Michal
It may very well be issue with the xscreensaver packaging in debian. It says that X11 screensaver extension is present but not compiled into xscreensaver. Extending the script to call not only xscreensaver but also the X11 Xss extension fixes the problem. I am not sure xscreensaver would try to use Xss in this case but since it is not complied in it's out of question anyway. Either way, xscreensaver-command -deactivate does not prevent screen from blanking so it does not perform as advertised and is undeniably broken even if you are saying it is not. Thanks Michal
No, xscreensaver should never be compiled with support for the MIT-SCREEN-SAVER extension. It's crap and breaks everything.
But now that I understand that you're talking not about xscreensaver activation but about DPMS only, I know what the problem is, and it is, as far as I know, impossible to fix portably. See the #if 0 block around line 348 of driver/timers.c:
/* This will (hopefully, supposedly) tell the server to re-set its
DPMS timer. Without this, the -deactivate clientmessage would
prevent xscreensaver from blanking, but would not prevent the
monitor from powering down. */
#if 0
/* #### With some servers, this causes the screen to flicker every
time a key is pressed! Ok, I surrender. I give up on ever
having DPMS work properly.
*/
So, X sucks and you are doomed.
Workaround: disable DPMS globally. Just let the screen saver paint the screen black instead of powering off the monitor. If you're using an LCD and not a CRT the difference in power consumption will probably be negligible anyway.
The difference in light output between a black screen and powered off screen is not negligible. The backlight just leaks somehow. It is true that using Xss requires a fork to get a sane semantics but since xscreensaver-command is a short-lived process that should not be a problem if the extension is used. And since the daemon is contacted over X protocol anyway there is no reason it has to be done in the daemon itself. And if XResetScreenSaver works that's fine too. Mplayer seems to use it and it does not cause screen flicker. It did not work with my test script, however. Since it returns a value I would expect that the call is finished by the time it returns but it might need a XFlush. Thanks Michal
No, that's not how xscreensaver-command works. I'm glad that your driver does not flicker. But others do. So like I said, this can't be solved portably. If you want to make it work on your machine and only your machine, flip the #if 0 and rebuild. But that cannot be done in general because that makes things terrible for people who have different hardware than you happen to.
Is it resetting screensaver or frobbing dpms what causes the flicker? And what drivers do cause it? Are they even in Debian? Thanks Michal
I don't know. I don't remember. I don't care. It is a thing that happens, and therefore it a constraint of the world with which I have to deal. This line of questioning will not make me change my mind. I'm not putting in special-case hacks just for the system you happen to be using this week. If that's what you want, compile your own private copy and enjoy. *I* have the goal of building software that works on *all* systems, not just yours.