Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > cd8ce32c919af60229fca1d7f792c60e > files > 106

openoffice.org-3.2.0-12.35.fc13.src.rpm


# HG changeset patch
# User cmc@openoffice.org
# Date 1256724641 0
# Node ID 170d9f615c3e644ce95635ba446cd9f4a7bedf1c
# Parent  ccdb8c85656c5ff3cd1ac7b527eac0227cfd7ced
gsminhibit: #i106372#: move to org.gnome.SessionManager

--- a/vcl/unx/gtk/window/gtkframe.cxx	Wed Oct 28 09:17:36 2009 +0000
+++ b/vcl/unx/gtk/window/gtkframe.cxx	Wed Oct 28 10:10:41 2009 +0000
@@ -70,9 +70,9 @@
 #ifdef ENABLE_DBUS
 #include <dbus/dbus-glib.h>
 
-#define GSS_DBUS_SERVICE        "org.gnome.ScreenSaver"
-#define GSS_DBUS_PATH           "/org/gnome/ScreenSaver"
-#define GSS_DBUS_INTERFACE      "org.gnome.ScreenSaver"
+#define GSM_DBUS_SERVICE        "org.gnome.SessionManager"
+#define GSM_DBUS_PATH           "/org/gnome/SessionManager"
+#define GSM_DBUS_INTERFACE      "org.gnome.SessionManager"
 #endif
 
 // make compile on gtk older than 2.10
@@ -565,7 +565,7 @@
     m_pIMHandler		= NULL;
     m_hBackgroundPixmap = None;
     m_nSavedScreenSaverTimeout = 0;
-    m_nGSSCookie = 0;
+    m_nGSMCookie = 0;
     m_nExtStyle         = 0;
     m_pRegion           = NULL;
     m_ePointerStyle     = 0xffff;
@@ -1904,8 +1904,9 @@
 #ifdef ENABLE_DBUS
 /** cookie is returned as an unsigned integer */
 static guint
-dbus_inhibit_gss (const gchar *appname,
-                  const gchar *reason)
+dbus_inhibit_gsm (const gchar *appname,
+                  const gchar *reason,
+                  guint xid)
 {
         gboolean         res;
         guint            cookie;
@@ -1921,20 +1922,22 @@
                 return -1;
         }
 
-        /* get the proxy with gnome-screensaver */
+        /* get the proxy with gnome-session-manager */
         proxy = dbus_g_proxy_new_for_name (session_connection,
-                                           GSS_DBUS_SERVICE,
-                                           GSS_DBUS_PATH,
-                                           GSS_DBUS_INTERFACE);
+                                           GSM_DBUS_SERVICE,
+                                           GSM_DBUS_PATH,
+                                           GSM_DBUS_INTERFACE);
         if (proxy == NULL) {
-                g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE);
+                g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE);
                 return -1;
         }
 
         res = dbus_g_proxy_call (proxy,
                                  "Inhibit", &error,
                                  G_TYPE_STRING, appname,
+                                 G_TYPE_UINT, xid,
                                  G_TYPE_STRING, reason,
+                                 G_TYPE_UINT, 8, //Inhibit the session being marked as idle
                                  G_TYPE_INVALID,
                                  G_TYPE_UINT, &cookie,
                                  G_TYPE_INVALID);
@@ -1957,15 +1960,14 @@
 }
 
 static void
-dbus_uninhibit_gss (guint cookie)
+dbus_uninhibit_gsm (guint cookie)
 {
         gboolean         res;
         GError          *error = NULL;
         DBusGProxy      *proxy = NULL;
         DBusGConnection *session_connection = NULL;
 
-        /* cookies have to be positive as unsigned */
-        if (cookie < 0) {
+        if (cookie == guint(-1)) {
                 g_warning ("Invalid cookie");
                 return;
         }
@@ -1978,18 +1980,18 @@
                 return;
         }
 
-        /* get the proxy with gnome-screensaver */
+        /* get the proxy with gnome-session-manager */
         proxy = dbus_g_proxy_new_for_name (session_connection,
-                                           GSS_DBUS_SERVICE,
-                                           GSS_DBUS_PATH,
-                                           GSS_DBUS_INTERFACE);
+                                           GSM_DBUS_SERVICE,
+                                           GSM_DBUS_PATH,
+                                           GSM_DBUS_INTERFACE);
         if (proxy == NULL) {
-                g_warning ("Could not get DBUS proxy: %s", GSS_DBUS_SERVICE);
+                g_warning ("Could not get DBUS proxy: %s", GSM_DBUS_SERVICE);
                 return;
         }
 
         res = dbus_g_proxy_call (proxy,
-                                 "UnInhibit",
+                                 "Uninhibit",
                                  &error,
                                  G_TYPE_UINT, cookie,
                                  G_TYPE_INVALID,
@@ -1997,12 +1999,12 @@
 
         /* check the return value */
         if (! res) {
-                g_warning ("UnInhibit method failed");
+                g_warning ("Uninhibit method failed");
         }
 
         /* check the error value */
         if (error != NULL) {
-                g_warning ("Inhibit problem : %s", error->message);
+                g_warning ("Uninhibit problem : %s", error->message);
                 g_error_free (error);
                 cookie = -1;
         }
@@ -2030,7 +2032,8 @@
 							 bPreferBlanking, bAllowExposures );
 		}
 #ifdef ENABLE_DBUS
-		m_nGSSCookie = dbus_inhibit_gss(g_get_application_name(), "presentation");
+		m_nGSMCookie = dbus_inhibit_gsm(g_get_application_name(), "presentation", 
+                    GDK_WINDOW_XID(m_pWindow->window));
 #endif
 	}
 	else
@@ -2041,7 +2044,7 @@
 							 bAllowExposures );
 		m_nSavedScreenSaverTimeout = 0;
 #ifdef ENABLE_DBUS
-		dbus_uninhibit_gss(m_nGSSCookie);
+		dbus_uninhibit_gsm(m_nGSMCookie);
 #endif
 	}
 }
--- a/vcl/unx/inc/plugins/gtk/gtkframe.hxx	Wed Oct 28 09:17:36 2009 +0000
+++ b/vcl/unx/inc/plugins/gtk/gtkframe.hxx	Wed Oct 28 10:10:41 2009 +0000
@@ -180,7 +180,7 @@
     GdkVisibilityState              m_nVisibility;
     PointerStyle                    m_ePointerStyle;
     int                             m_nSavedScreenSaverTimeout;
-    guint                           m_nGSSCookie;
+    guint                           m_nGSMCookie;
     int                             m_nWorkArea;
     bool                            m_bFullscreen;
     bool                            m_bSingleAltPress;