]> Dogcows Code - chaz/openbox/commitdiff
don't grab the pointer during interactive events. this allows you to alt-tab during...
authorDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 15:22:25 +0000 (15:22 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 22 Apr 2007 15:22:25 +0000 (15:22 +0000)
openbox/client.c
openbox/event.c
openbox/focus.c
openbox/keyboard.c
openbox/popup.c

index e7af570150a7040868231c41851ef0f8fb889c54..86acafb11ae23cb31c4284f012b69347b53bcff7 100644 (file)
@@ -507,6 +507,8 @@ void client_unmanage(ObClient *self)
     g_assert(self != NULL);
 
     frame_hide(self->frame);
+    /* sync to send the hide to the server quickly, and to get back the enter
+       events */
     XSync(ob_display, FALSE);
 
     if (focus_client == self) {
index 871b158a491591210b716ff09eec73404725de67..502d196214957381468d58e30bf85740f7c50856 100644 (file)
@@ -590,9 +590,10 @@ static void event_process(const XEvent *ec, gpointer data)
                                          NULL, g_direct_equal, NULL);
 
                 if (e->type == ButtonPress || e->type == ButtonRelease ||
-                    e->type == MotionNotify)
-                    mouse_event(client, e);
-                else if (e->type == KeyPress) {
+                    e->type == MotionNotify) {
+                    if (!keyboard_interactively_grabbed())
+                        mouse_event(client, e);
+                } else if (e->type == KeyPress) {
                     keyboard_event((focus_cycle_target ? focus_cycle_target :
                                     (focus_hilite ? focus_hilite : client)),
                                    e);
@@ -762,6 +763,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
             frame_adjust_state(client->frame);
             break;
         case OB_FRAME_CONTEXT_FRAME:
+            if (keyboard_interactively_grabbed())
+                break;
             if (config_focus_follow && config_focus_delay)
                 ob_main_loop_timeout_remove_data(ob_main_loop,
                                                  focus_delay_func,
@@ -803,6 +806,8 @@ static void event_handle_client(ObClient *client, XEvent *e)
             frame_adjust_state(client->frame);
             break;
         case OB_FRAME_CONTEXT_FRAME:
+            if (keyboard_interactively_grabbed())
+                break;
             if (e->xcrossing.mode == NotifyGrab ||
                 e->xcrossing.mode == NotifyUngrab)
             {
index 197948e98c286c619a01cbd24036d16d45aac0d3..ea3d4fab0d75eb37c7d0a6d451c772f4effa22ac 100644 (file)
@@ -328,10 +328,16 @@ static void popup_cycle(ObClient *c, gboolean show)
 void focus_cycle_draw_indicator()
 {
     if (!focus_cycle_target) {
+        XEvent e;
+
         XUnmapWindow(ob_display, focus_indicator.top.win);
         XUnmapWindow(ob_display, focus_indicator.left.win);
         XUnmapWindow(ob_display, focus_indicator.right.win);
         XUnmapWindow(ob_display, focus_indicator.bottom.win);
+
+        /* kill enter events cause by this unmapping */
+        XSync(ob_display, FALSE);
+        while (XCheckTypedEvent(ob_display, EnterNotify, &e));
     } else {
         /*
           if (focus_cycle_target)
index 248fd1ce0dd4bdf682152a371476fe92b2e95b8e..ba4559551a3e00c127a2ec793e796e5e0bd42df4 100644 (file)
@@ -164,10 +164,8 @@ gboolean keyboard_interactive_grab(guint state, ObClient *client,
     g_assert(action->data.any.interactive);
 
     if (!interactive_states) {
-        if (!grab_keyboard(TRUE))
-            return FALSE;
-        if (!grab_pointer(TRUE, FALSE, OB_CURSOR_NONE)) {
-            grab_keyboard(FALSE);
+        if (!grab_keyboard(TRUE)) {
+            ob_debug("grab KEYBOARD failed\n");
             return FALSE;
         }
     }
@@ -195,7 +193,6 @@ void keyboard_interactive_end(ObInteractiveState *s,
 
     if (!interactive_states) {
         grab_keyboard(FALSE);
-        grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
         keyboard_reset_chains();
     }
 }
index e7fcbbe552acbf9c93a3e2f29dd3137f9fade101..ee44ed2352688d4a013598630ddb8f88a02e517b 100644 (file)
@@ -213,8 +213,14 @@ void popup_show(ObPopup *self, gchar *text)
 void popup_hide(ObPopup *self)
 {
     if (self->mapped) {
+        XEvent e;
+
         XUnmapWindow(ob_display, self->bg);
         self->mapped = FALSE;
+
+        /* kill enter events cause by this unmapping */
+        XSync(ob_display, FALSE);
+        while (XCheckTypedEvent(ob_display, EnterNotify, &e));
     }
 }
 
This page took 0.033637 seconds and 4 git commands to generate.