]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_menu.c
very cool struts. partial struts actually are partial struts now. possibly way broken...
[chaz/openbox] / openbox / client_menu.c
index 6fa744c41b8545790886c873251a921e4b4f7b6a..ce29db10b5945d0ad0220a507391b8103b74a4bd 100644 (file)
@@ -19,6 +19,7 @@
 #include "debug.h"
 #include "menu.h"
 #include "menuframe.h"
+#include "config.h"
 #include "screen.h"
 #include "client.h"
 #include "openbox.h"
@@ -106,9 +107,13 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
                                 Time time)
 {
     gint x, y;
+    gulong ignore_start;
 
     g_assert(c);
 
+    if (!config_focus_under_mouse)
+        ignore_start = event_start_ignore_all_enters();
+
     switch (e->id) {
     case CLIENT_ICONIFY:
         /* the client won't be on screen anymore so hide the menu */
@@ -119,19 +124,15 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         break;
     case CLIENT_RESTORE:
         client_maximize(c, FALSE, 0);
-        event_ignore_queued_enters();
         break;
     case CLIENT_MAXIMIZE:
         client_maximize(c, TRUE, 0);
-        event_ignore_queued_enters();
         break;
     case CLIENT_SHADE:
         client_shade(c, !c->shaded);
-        event_ignore_queued_enters();
         break;
     case CLIENT_DECORATE:
         client_set_undecorated(c, !c->undecorated);
-        event_ignore_queued_enters();
         break;
     case CLIENT_MOVE:
         /* this needs to grab the keyboard so hide the menu */
@@ -158,6 +159,9 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         g_assert_not_reached();
     }
 
+    if (!config_focus_under_mouse)
+        event_end_ignore_all_enters(ignore_start);
+
     /* update the menu cuz stuff can have changed */
     if (f) {
         client_menu_update(f, NULL);
@@ -201,8 +205,13 @@ static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
                                ObClient *c, guint state, gpointer data,
                                Time time)
 {
+    gulong ignore_start;
+
     g_assert(c);
 
+    if (!config_focus_under_mouse)
+        ignore_start = event_start_ignore_all_enters();
+
     switch (e->id) {
     case LAYER_TOP:
         client_set_layer(c, 1);
@@ -217,7 +226,8 @@ static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         g_assert_not_reached();
     }
 
-    event_ignore_queued_enters();
+    if (!config_focus_under_mouse)
+        event_end_ignore_all_enters(ignore_start);
 
     /* update the menu cuz stuff can have changed */
     if (f) {
This page took 0.021627 seconds and 4 git commands to generate.