Package: xscreensaver Version: 5.23-1 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 -- System Information: Debian Release: 7.3 APT prefers stable APT policy: (990, 'stable'), (171, 'unstable'), (151, 'experimental'), (121, 'precise-updates'), (121, 'precise-security'), (121, 'precise'), (101, 'stable'), (101, 'oldstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 3.11-trunk-amd64 (SMP w/2 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Versions of packages xscreensaver depends on: ii libatk1.0-0 2.10.0-2 ii libc6 2.17-97 ii libcairo2 1.12.16-2 ii libfontconfig1 2.11.0-2 ii libfreetype6 2.4.9-1.1 ii libgdk-pixbuf2.0-0 2.28.2-1+b1 ii libglade2-0 1:2.6.4-1 ii libglib2.0-0 2.38.2-1 ii libgtk2.0-0 2.24.22-1 ii libice6 2:1.0.8-2 ii libpam0g 1.1.3-7.1 ii libpango-1.0-0 1.36.0-1+b1 ii libpangocairo-1.0-0 1.36.0-1+b1 ii libpangoft2-1.0-0 1.36.0-1+b1 ii libsm6 2:1.2.1-2 ii libx11-6 2:1.5.0-1+deb7u1 ii libxext6 2:1.3.1-2+deb7u1 ii libxi6 2:1.6.1-1+deb7u1 ii libxinerama1 2:1.1.2-1+deb7u1 ii libxml2 2.8.0+dfsg1-7+nmu2 ii libxmu6 2:1.1.1-1 ii libxpm4 1:3.5.10-1 ii libxrandr2 2:1.3.2-2+deb7u1 ii libxrender1 1:0.9.7-1+deb7u1 ii libxt6 1:1.1.3-1+deb7u1 ii libxxf86vm1 1:1.1.2-1+deb7u1 ii xscreensaver-data 5.15-3 Versions of packages xscreensaver recommends: ii libjpeg-progs 8d-1 ii miscfiles [wordlist] 1.4.2.dfsg.1-9 ii perl [perl5] 5.14.2-21+deb7u1 Versions of packages xscreensaver suggests: ii chromium [www-browser] 31.0.1650.63-1~deb7u1 ii elinks [www-browser] 0.12~pre5-9 ii fortune-mod [fortune] 1:1.99.1-4 ii galeon [www-browser] 2.0.7-2.1+b1 pn gdm3 | kdm-gdmcompat <none> ii iceweasel [www-browser] 17.0.10esr-1~deb7u1 ii midori [www-browser] 0.4.3+dfsg-0.1 pn qcam | streamer <none> ii w3m [www-browser] 0.5.3-8 pn xdaliclock <none> pn xfishtank <none> ii xscreensaver-gl 5.15-3 -- no debconf information
#!/usr/bin/env python # Copyright (C) 2004-2006 Red Hat Inc. <http://www.redhat.com/> # Copyright (C) 2005-2007 Collabora Ltd. <http://www.collabora.co.uk/> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal in the Software without # restriction, including without limitation the rights to use, copy, # modify, merge, publish, distribute, sublicense, and/or sell copies # of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be # included in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT # HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, # WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. #dbus_interface "org.gnome.SessionManager" do #dbus_method :Inhibit, "out ret:i" do #[system("xscreensave-command -deactivate")] import gobject import dbus import dbus.service import dbus.mainloop.glib import subprocess import time class ScreenSaverInhibitor(dbus.service.Object): @dbus.service.method("org.gnome.SessionManager", in_signature='susu', out_signature='u') def Inhibit(self, app, xid, reason, flags): print (time.ctime(time.time()) +" " +app + hex(xid) + " disables screensaver because " + reason + hex(flags) + "\n") print (subprocess.check_output(["/usr/bin/xscreensaver-command", "-deactivate"])) return 0 @dbus.service.method("org.gnome.SessionManager", in_signature='u', out_signature='') def UnInhibit(self, cookie): print ( "Given ununinhibit cookie " + str(cookie) + "\n") @dbus.service.method("org.gnome.SessionManager", in_signature='u', out_signature='b') def IsInhibited(self, flags): print ( "Given inhibition flags " + hex(flags) + "\n") return False if __name__ == '__main__': dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) session_bus = dbus.SessionBus() name = dbus.service.BusName("org.gnome.SessionManager", session_bus) object = ScreenSaverInhibitor(session_bus, '/org/gnome/SessionManager') mainloop = gobject.MainLoop() print "Running screensaver inhibitor." mainloop.run()