[Xfce4-commits] <xfce4-screenshooter:master> Do not check for grab status when not composited.

Jérôme Guelfucci noreply at xfce.org
Sat Nov 7 23:04:01 CET 2009


Updating branch refs/heads/master
         to 5854a53d8168fe1e2fedcf4c3e2be1261e027e2e (commit)
       from 9ae621cf326cded6ee3f8ab5606cdeff01886c84 (commit)

commit 5854a53d8168fe1e2fedcf4c3e2be1261e027e2e
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Sat Nov 7 23:01:35 2009 +0100

    Do not check for grab status when not composited.
    
    This caused xfce4-screenshooter -r to be unusable as a command for a
    keyboard shortcut, as the keyboard was already grabbed by the thingy
    which launches applications from shortcuts. Escape is still not usable
    in that case, but that's normal as we don't grab the keyboard...

 lib/screenshooter-capture.c |   25 +++++--------------------
 1 files changed, 5 insertions(+), 20 deletions(-)

diff --git a/lib/screenshooter-capture.c b/lib/screenshooter-capture.c
index 3447465..b7438ff 100644
--- a/lib/screenshooter-capture.c
+++ b/lib/screenshooter-capture.c
@@ -655,7 +655,6 @@ static GdkPixbuf
 
   GdkGCValues gc_values;
   GdkGC *gc;
-  GdkGrabStatus grabstatus_mouse, grabstatus_keyboard;
 
   GdkGCValuesMask values_mask =
     GDK_GC_FUNCTION | GDK_GC_FILL	| GDK_GC_CLIP_MASK |
@@ -703,13 +702,10 @@ static GdkPixbuf
   /* Change cursor to cross-hair */
   TRACE ("Set the cursor");
 
-  grabstatus_mouse =
-    gdk_pointer_grab (root_window, FALSE, mask, NULL, xhair_cursor, GDK_CURRENT_TIME);
+  gdk_pointer_grab (root_window, FALSE, mask, NULL, xhair_cursor, GDK_CURRENT_TIME);
+  gdk_keyboard_grab (root_window, FALSE, GDK_CURRENT_TIME);
 
-  grabstatus_keyboard = gdk_keyboard_grab (root_window, FALSE, GDK_CURRENT_TIME);
-
-  while (!done && grabstatus_mouse == GDK_GRAB_SUCCESS
-               && grabstatus_keyboard == GDK_GRAB_SUCCESS)
+  while (!done)
     {
       gint x1, y1, x2, y2;
       GdkEvent *event;
@@ -832,19 +828,8 @@ static GdkPixbuf
       gdk_event_free (event);
     }
 
-  if (grabstatus_mouse == GDK_GRAB_SUCCESS)
-    {
-      TRACE ("Ungrab the pointer");
-
-      gdk_pointer_ungrab(GDK_CURRENT_TIME);
-    }
-
-  if (grabstatus_keyboard == GDK_GRAB_SUCCESS)
-    {
-      TRACE ("Ungrab the keyboard");
-
-      gdk_keyboard_ungrab (GDK_CURRENT_TIME);
-    }
+  gdk_pointer_ungrab(GDK_CURRENT_TIME);
+  gdk_keyboard_ungrab (GDK_CURRENT_TIME);
 
   /* Get the screenshot's pixbuf */
 



More information about the Xfce4-commits mailing list