From a6f52b90551621316a36f7cd7b20ef1d5dca0782 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 2 May 2007 03:10:25 +0000 Subject: better menu keyboard handling. also, when you hit a keybinding while menus are open, it will close the menus and run the binding. --- openbox/keyboard.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'openbox/keyboard.c') diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 1509f69f..ccfe0497 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -27,6 +27,7 @@ #include "client.h" #include "action.h" #include "prop.h" +#include "menuframe.h" #include "config.h" #include "keytree.h" #include "keyboard.h" @@ -297,6 +298,10 @@ void keyboard_event(ObClient *client, const XEvent *e) if (p->key == e->xkey.keycode && p->state == e->xkey.state) { + /* if we hit a key binding, then close any open menus and run it */ + if (menu_frame_visible) + menu_frame_hide_all(); + if (p->first_child != NULL) { /* part of a chain */ ob_main_loop_timeout_remove(ob_main_loop, chain_timeout); /* 3 second timeout for chains */ -- cgit v1.2.3