[totem] lib: Use gnome-session to Inhibit idle



commit c6fc9c4785904cda4b648dbdbd24958d1010c4a1
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Mar 10 14:01:06 2011 +0000

    lib: Use gnome-session to Inhibit idle

 lib/totem-scrsaver.c |   18 ++++++++++++------
 1 files changed, 12 insertions(+), 6 deletions(-)
---
diff --git a/lib/totem-scrsaver.c b/lib/totem-scrsaver.c
index e173d61..08847ad 100644
--- a/lib/totem-scrsaver.c
+++ b/lib/totem-scrsaver.c
@@ -41,9 +41,11 @@
 
 #include "totem-scrsaver.h"
 
-#define GS_SERVICE   "org.gnome.ScreenSaver"
-#define GS_PATH      "/org/gnome/ScreenSaver"
-#define GS_INTERFACE "org.gnome.ScreenSaver"
+#define GS_SERVICE   "org.gnome.SessionManager"
+#define GS_PATH      "/org/gnome/SessionManager"
+#define GS_INTERFACE "org.gnome.SessionManager"
+/* From org.gnome.SessionManager.xml */
+#define GS_NO_IDLE_FLAG 8
 
 #define XSCREENSAVER_MIN_TIMEOUT 60
 
@@ -144,19 +146,23 @@ screensaver_inhibit_dbus (TotemScrsaver *scr,
 			  gboolean	 inhibit)
 {
         TotemScrsaverPrivate *priv = scr->priv;
+        guint xid;
 
         if (!priv->have_screensaver_dbus)
                 return;
 
 	g_object_ref (scr);
 
+	xid = 0;
 	if (inhibit) {
 		g_return_if_fail (scr->priv->reason != NULL);
 		g_dbus_proxy_call (priv->gs_proxy,
 				   "Inhibit",
-				   g_variant_new ("(ss)",
+				   g_variant_new ("(susu)",
 						  g_get_application_name (),
-						  scr->priv->reason),
+						  xid,
+						  scr->priv->reason,
+						  GS_NO_IDLE_FLAG),
 				   G_DBUS_CALL_FLAGS_NO_AUTO_START,
 				   -1,
 				   NULL,
@@ -164,7 +170,7 @@ screensaver_inhibit_dbus (TotemScrsaver *scr,
 				   scr);
 	} else {
                 g_dbus_proxy_call (priv->gs_proxy,
-				   "UnInhibit",
+				   "Uninhibit",
 				   g_variant_new ("(u)", priv->cookie),
 				   G_DBUS_CALL_FLAGS_NO_AUTO_START,
 				   -1,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]