]> Dogcows Code - chaz/openbox/commitdiff
ok, so, back out the last commit. owner events are passed thru so we get enter/leave...
authorDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 00:40:01 +0000 (00:40 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 8 May 2007 00:40:01 +0000 (00:40 +0000)
dont change frame decor from button presses during an interactive grab or
while a menu is open

openbox/event.c
openbox/menuframe.c

index bb6a42f964de889d8ec1d3d3d907d067c3d7efb3..a3ca558521ded5d6fe1acaa2b2cb9d97a74bad1d 100644 (file)
@@ -709,8 +709,15 @@ static void event_handle_client(ObClient *client, XEvent *e)
     case ButtonPress:
     case ButtonRelease:
         /* Wheel buttons don't draw because they are an instant click, so it
-           is a waste of resources to go drawing it. */
-        if (!(e->xbutton.button == 4 || e->xbutton.button == 5)) {
+           is a waste of resources to go drawing it.
+           if the user is doing an intereactive thing, or has a menu open then
+           the mouse is grabbed (possibly) and if we get these events we don't
+           want to deal with them
+        */
+        if (!(e->xbutton.button == 4 || e->xbutton.button == 5) &&
+            !keyboard_interactively_grabbed() &&
+            !menu_frame_visible)
+        {
             con = frame_context(client, e->xbutton.window);
             con = mouse_button_frame_context(con, e->xbutton.button);
             switch (con) {
index 461a2f2a3727948d76f7a4786b0d25ab0430b2d6..768176abcb218cae14fa026f4cce42675b3e197f 100644 (file)
@@ -912,10 +912,10 @@ static gboolean menu_frame_show(ObMenuFrame *self)
 
     if (menu_frame_visible == NULL) {
         /* no menus shown yet */
-        if (!grab_pointer(TRUE, FALSE, OB_CURSOR_POINTER))
+        if (!grab_pointer(TRUE, TRUE, OB_CURSOR_POINTER))
             return FALSE;
         if (!grab_keyboard(TRUE)) {
-            grab_pointer(FALSE, FALSE, OB_CURSOR_POINTER);
+            grab_pointer(FALSE, TRUE, OB_CURSOR_POINTER);
             return FALSE;
         }
     }
@@ -1024,7 +1024,7 @@ void menu_frame_hide(ObMenuFrame *self)
 
     if (menu_frame_visible == NULL) {
         /* last menu shown */
-        grab_pointer(FALSE, FALSE, OB_CURSOR_NONE);
+        grab_pointer(FALSE, TRUE, OB_CURSOR_NONE);
         grab_keyboard(FALSE);
     }
 
This page took 0.029138 seconds and 4 git commands to generate.