all repos — openbox @ 1ffd89672fa62cdf2c9e707fdf53e6d8a0080b6f

openbox fork - make it a bit more like ryudo

don't allow inventive users to open the menu while in an interactive grab (ie changing focus or desktop)
Mikael Magnusson mikachu@comhem.se
commit

1ffd89672fa62cdf2c9e707fdf53e6d8a0080b6f

parent

5b288939ab50d32731729239670142d3376429b8

3 files changed, 9 insertions(+), 1 deletions(-)

jump to
M openbox/keyboard.copenbox/keyboard.c

@@ -288,6 +288,11 @@ p = p->next_sibling;

} } +gboolean keyboard_interactively_grabbed() +{ + return !!interactive_states; +} + void keyboard_startup(gboolean reconfig) { grab_keys(TRUE);
M openbox/keyboard.hopenbox/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);
M openbox/menu.copenbox/menu.c

@@ -24,6 +24,7 @@ #include "client.h"

#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 @@ ObMenu *self;

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 */