]> Dogcows Code - chaz/openbox/commitdiff
don't allow inventive users to open the menu while in an interactive grab (ie changin...
authorMikael Magnusson <mikachu@comhem.se>
Wed, 16 Aug 2006 17:38:41 +0000 (17:38 +0000)
committerMikael Magnusson <mikachu@comhem.se>
Wed, 16 Aug 2006 17:38:41 +0000 (17:38 +0000)
openbox/keyboard.c
openbox/keyboard.h
openbox/menu.c

index 7f930f8f574ca55191cb2347c17a4ffd5a78bad7..09b99bcc583c16193e4969934a1e6b44721153fe 100644 (file)
@@ -288,6 +288,11 @@ void keyboard_event(ObClient *client, const XEvent *e)
     }
 }
 
+gboolean keyboard_interactively_grabbed()
+{
+    return !!interactive_states;
+}
+
 void keyboard_startup(gboolean reconfig)
 {
     grab_keys(TRUE);
index 8a9eb47f965202b65eb0fd95116b3f98a660e0e4..6e539cffe46a5b51f23b7abad409e40ca3ba71a7 100644 (file)
@@ -43,6 +43,7 @@ gboolean keyboard_interactive_grab(guint state, struct _ObClient *client,
                                    struct _ObAction *action);
 gboolean keyboard_process_interactive_grab(const XEvent *e,
                                            struct _ObClient **client);
+gboolean keyboard_interactively_grabbed();
 
 void keyboard_grab_for_client(struct _ObClient *c, gboolean grab);
 
index 503876655570f93d13d9e3462c1cc8a9ed95d25b..c1d1138be270ad8652a0bc9501f7336b5eec0828 100644 (file)
@@ -24,6 +24,7 @@
 #include "config.h"
 #include "screen.h"
 #include "menuframe.h"
+#include "keyboard.h"
 #include "geom.h"
 #include "misc.h"
 #include "client_menu.h"
@@ -286,7 +287,8 @@ void menu_show(gchar *name, gint x, gint y, ObClient *client)
     ObMenuFrame *frame;
     guint i;
 
-    if (!(self = menu_from_name(name))) return;
+    if (!(self = menu_from_name(name))
+        || keyboard_interactively_grabbed()) return;
 
     /* if the requested menu is already the top visible menu, then don't
        bother */
This page took 0.027241 seconds and 4 git commands to generate.