gnome-screensaver-command --poke has been removed. Closes: #610155. --- I'm not sure how far back this DBus API is supported; I've only tested in sid.
Ben.
debian/changelog | 6 +++
debian/control | 3 +-
debian/patches/series | 1 +
debian/patches/xdg-screensaver-new-gnome.diff | 60 +++++++++++++++++++++++++
4 files changed, 69 insertions(+), 1 deletions(-)
create mode 100644 debian/patches/xdg-screensaver-new-gnome.diff
diff --git a/debian/changelog b/debian/changelog
index 5accedc..d8fe9f9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,15 @@
xdg-utils (1.1.0~rc1-3) UNRELEASED; urgency=low
+ [ Per Olofsson ]
* Remove debian/patches/xserver-blanking.diff, already applied
upstream. Thanks to Tanguy Ortolo for spotting this.
Closes: #647794.
+ [ Ben Hutchings ]
+ * Add patch xdg-screensaver-new-gnome.diff: Use DBus API for GNOME
+ since gnome-screensaver-command --poke has been removed.
+ Closes: #610155.
+
-- Per Olofsson <[email protected]> Tue, 08 Nov 2011 00:09:18 +0100
xdg-utils (1.1.0~rc1-2) unstable; urgency=low
diff --git a/debian/control b/debian/control
index a5b89be..bf61964 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,8 @@ Homepage: http://portland.freedesktop.org/
Package: xdg-utils
Architecture: all
Depends: ${misc:Depends}
-Recommends: libfile-mimeinfo-perl, x11-utils, x11-xserver-utils
+Recommends: libfile-mimeinfo-perl, libnet-dbus-perl, libx11-protocol-perl,
+ x11-utils, x11-xserver-utils
Suggests: gvfs-bin
Description: desktop integration utilities from freedesktop.org
xdg-utils contains utilities for integrating applications with the
diff --git a/debian/patches/series b/debian/patches/series
index 370bb95..7574299 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ xdg-mime-generic-use-mimetype.diff
bashisms.diff
xdg-open-browser-multiword.diff
xdg-open-printf.diff
+xdg-screensaver-new-gnome.diff
diff --git a/debian/patches/xdg-screensaver-new-gnome.diff
b/debian/patches/xdg-screensaver-new-gnome.diff
new file mode 100644
index 0000000..679c448
--- /dev/null
+++ b/debian/patches/xdg-screensaver-new-gnome.diff
@@ -0,0 +1,60 @@
+Description: Use DBus API for GNOME since gnome-screensaver-command --poke
+ has been removed
+Author: Ben Hutchings <[email protected]>
+Bug: http://bugs.debian.org/610155
+
+--- xdg-utils.orig/scripts/xdg-screensaver
++++ xdg-utils/scripts/xdg-screensaver
+@@ -762,15 +762,45 @@
+
+ screensaver_gnome_screensaver()
+ {
+-# TODO
+-# There seems to be a DBUS interface for gnome-screensaver
+-# See
http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/2006-April/042579.html and
+-#
http://cvs.gnome.org/viewcvs/gnome-screensaver/src/gs-listener-dbus.c?rev=1.36&view=log
+-# A problem seems to be that Inhibit is tied to the lifetime of the DBUS
appname and
+-# this can not be used from a script
+ case "$1" in
+ suspend)
+- screensaver_suspend_loop gnome-screensaver-command --poke
++ perl -e '
++use strict;
++use warnings;
++use IO::File;
++use Net::DBus;
++use X11::Protocol;
++
++my ($window_id, $screensaver_file) = @ARGV;
++
++# Find window name to pass to session manager.
++my $x = X11::Protocol->new();
++my ($window_name) = $x->GetProperty(hex($window_id), $x->atom("WM_NAME"),
++ $x->atom("STRING"), 0, 1000, 0);
++
++# Inhibit idle detection (flags = 8) with window name and ID.
++# We have no reason so just send the window name again.
++my $bus = Net::DBus->session();
++my $sm_svc = $bus->get_service("org.gnome.SessionManager");
++my $sm = $sm_svc->get_object("/org/gnome/SessionManager",
++ "org.gnome.SessionManager");
++$sm->Inhibit($window_name, hex($window_id), $window_name, 8);
++
++# Wait until removed from the status file.
++while (1) {
++ sleep(10);
++ my $status = new IO::File($screensaver_file, "r")
++ or exit 0;
++ my $found;
++ while (<$status>) {
++ if (/^$window_id:/) {
++ $found = 1;
++ last;
++ }
++ }
++ exit 0 unless $found;
++}
++' $window_id $screensaver_file &
+ result=0
+ ;;
+
--
1.7.7.3
signature.asc
Description: This is a digitally signed message part

