]> Dogcows Code - chaz/openbox/blobdiff - openbox/client_menu.c
add the cyclewindows action
[chaz/openbox] / openbox / client_menu.c
index f538eafd7f36ae263a81e2feecd8bba0f932073a..e92a772cc827f7465f4e7b961b86d18d246b1526 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"
@@ -102,13 +103,16 @@ static gboolean client_menu_update(ObMenuFrame *frame, gpointer data)
 }
 
 static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
-                                ObClient *c, guint state, gpointer data,
-                                Time time)
+                                ObClient *c, guint state, gpointer data)
 {
     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 */
@@ -154,7 +158,8 @@ static void client_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         g_assert_not_reached();
     }
 
-    event_ignore_all_queued_enters();
+    if (!config_focus_under_mouse)
+        event_end_ignore_all_enters(ignore_start);
 
     /* update the menu cuz stuff can have changed */
     if (f) {
@@ -196,11 +201,15 @@ static gboolean layer_menu_update(ObMenuFrame *frame, gpointer data)
 }
 
 static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
-                               ObClient *c, guint state, gpointer data,
-                               Time time)
+                               ObClient *c, guint state, gpointer data)
 {
+    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);
@@ -215,7 +224,8 @@ static void layer_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
         g_assert_not_reached();
     }
 
-    event_ignore_all_queued_enters();
+    if (!config_focus_under_mouse)
+        event_end_ignore_all_enters(ignore_start);
 
     /* update the menu cuz stuff can have changed */
     if (f) {
@@ -269,23 +279,22 @@ static gboolean send_to_menu_update(ObMenuFrame *frame, gpointer data)
 }
 
 static void send_to_menu_execute(ObMenuEntry *e, ObMenuFrame *f,
-                                 ObClient *c, guint state, gpointer data,
-                                 Time time)
+                                 ObClient *c, guint state, gpointer data)
 {
     g_assert(c);
 
-    client_set_desktop(c, e->id, FALSE);
+    client_set_desktop(c, e->id, FALSE, FALSE);
     /* the client won't even be on the screen anymore, so hide the menu */
     if (f)
         menu_frame_hide_all();
 }
 
 static void client_menu_place(ObMenuFrame *frame, gint *x, gint *y,
-                              gint button, gpointer data)
+                              gboolean mouse, gpointer data)
 {
     gint dx, dy;
 
-    if (button == 0 && frame->client) {
+    if (!mouse && frame->client) {
         *x = frame->client->frame->area.x;
 
         /* try below the titlebar */
This page took 0.02524 seconds and 4 git commands to generate.