diff options
| author | Mikael Magnusson <mikachu@comhem.se> | 2006-08-16 17:38:41 +0000 |
|---|---|---|
| committer | Mikael Magnusson <mikachu@comhem.se> | 2006-08-16 17:38:41 +0000 |
| commit | 1ffd89672fa62cdf2c9e707fdf53e6d8a0080b6f (patch) | |
| tree | 4c686850fa21ad1bd80fcdcfdd81d03d8aaef6be /openbox | |
| parent | 5b288939ab50d32731729239670142d3376429b8 (diff) | |
don't allow inventive users to open the menu while in an interactive grab (ie changing focus or desktop)
Diffstat (limited to 'openbox')
| -rw-r--r-- | openbox/keyboard.c | 5 | ||||
| -rw-r--r-- | openbox/keyboard.h | 1 | ||||
| -rw-r--r-- | openbox/menu.c | 4 |
3 files changed, 9 insertions, 1 deletions
diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 7f930f8f..09b99bcc 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -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); diff --git a/openbox/keyboard.h b/openbox/keyboard.h index 8a9eb47f..6e539cff 100644 --- a/openbox/keyboard.h +++ b/openbox/keyboard.h @@ -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); diff --git a/openbox/menu.c b/openbox/menu.c index 50387665..c1d1138b 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -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 */ |
