]> Dogcows Code - chaz/openbox/commitdiff
playing a bit with grabs
authorDana Jansens <danakj@orodu.net>
Wed, 25 Apr 2007 14:13:32 +0000 (14:13 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 25 Apr 2007 14:13:32 +0000 (14:13 +0000)
make mouse clicks cancel alt-tab and stuff if you arent dragging during the alt-tab

openbox/grab.c
openbox/grab.h
openbox/keyboard.c

index e7bd41d957deb1a75ee05587c9195a6a9681a41b..eaf65f6be9765b8ec539158b86500df581a75027 100644 (file)
@@ -166,18 +166,13 @@ void grab_button_full(guint button, guint state, Window win, guint mask,
     xerror_set_ignore(TRUE); /* can get BadAccess from these */
     xerror_occured = FALSE;
     for (i = 0; i < MASK_LIST_SIZE; ++i)
-        XGrabButton(ob_display, button, state | mask_list[i], win, FALSE, mask,
-                    pointer_mode, GrabModeSync, None, ob_cursor(cur));
+        XGrabButton(ob_display, button, state | mask_list[i], win, False, mask,
+                    pointer_mode, GrabModeAsync, None, ob_cursor(cur));
     xerror_set_ignore(FALSE);
     if (xerror_occured)
         ob_debug("Failed to grab button %d modifiers %d", button, state);
 }
 
-void grab_button(guint button, guint state, Window win, guint mask)
-{
-    grab_button_full(button, state, win, mask, GrabModeAsync, OB_CURSOR_NONE);
-}
-
 void ungrab_button(guint button, guint state, Window win)
 {
     guint i;
index 4b5aec3be993d5fa886ab03f41dbd0fe09a1d4c7..67dff212db3866776ce675ae83587fe83055978f 100644 (file)
@@ -34,7 +34,6 @@ gint grab_server(gboolean grab);
 gboolean grab_on_keyboard();
 gboolean grab_on_pointer();
 
-void grab_button(guint button, guint state, Window win, guint mask);
 void grab_button_full(guint button, guint state, Window win, guint mask,
                       gint pointer_mode, ObCursor cursor);
 void ungrab_button(guint button, guint state, Window win);
index 6adb0aa9fa14f2cb3b0195fa914e81d4435333bc..f9716c3028f91389151dcadced0a1bdaf01103e3 100644 (file)
@@ -159,8 +159,11 @@ gboolean keyboard_interactive_grab(guint state, ObClient *client,
     g_assert(action->data.any.interactive);
 
     if (!interactive_states) {
-        if (!grab_keyboard(TRUE))
+        grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER);
+        if (!grab_keyboard(TRUE)) {
+            grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
             return FALSE;
+        }
     }
 
     s = g_new(ObInteractiveState, 1);
@@ -186,6 +189,7 @@ void keyboard_interactive_end(ObInteractiveState *s,
 
     if (!interactive_states) {
         grab_keyboard(FALSE);
+        grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
         keyboard_reset_chains();
     }
 }
@@ -224,7 +228,9 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client)
                 done = TRUE;
             else */if (e->xkey.keycode == ob_keycode(OB_KEY_ESCAPE))
                 cancel = done = TRUE;
-        }
+        } else if (e->type == ButtonPress)
+            cancel = done = TRUE;
+
         if (done) {
             keyboard_interactive_end(s, e->xkey.state, cancel, e->xkey.time);
 
This page took 0.024913 seconds and 4 git commands to generate.