gnome-screensaver r1545 - in trunk: . src



Author: mccann
Date: Wed Nov 12 16:45:12 2008
New Revision: 1545
URL: http://svn.gnome.org/viewvc/gnome-screensaver?rev=1545&view=rev

Log:
2008-11-12  William Jon McCann  <jmccann redhat com>

	* src/gs-grab-x11.c (gs_grab_grab_window):
	Release mouse/keyboard when failed to grab both of them.
	Based on patch from: Joey Yu Zheng <joey yuzheng gmail com>
	Fixes #555491



Modified:
   trunk/ChangeLog
   trunk/src/gs-grab-x11.c

Modified: trunk/src/gs-grab-x11.c
==============================================================================
--- trunk/src/gs-grab-x11.c	(original)
+++ trunk/src/gs-grab-x11.c	Wed Nov 12 16:45:12 2008
@@ -462,10 +462,20 @@
 
         if (kstatus != GDK_GRAB_SUCCESS || mstatus != GDK_GRAB_SUCCESS) {
                 /* Do not blank without a keyboard and mouse grabs. */
+
+                /* Release keyboard or mouse which was grabbed. */
+                if (kstatus == GDK_GRAB_SUCCESS) {
+                        gs_grab_release_keyboard (grab);
+                }
+                if (mstatus == GDK_GRAB_SUCCESS) {
+                        gs_grab_release_mouse (grab);
+                }
+
                 return FALSE;
         }
 
-        return TRUE;			/* Grab is good, go ahead and blank.  */
+        /* Grab is good, go ahead and blank.  */
+        return TRUE;
 }
 
 /* this is used to grab the keyboard and mouse to the root */



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