summaryrefslogtreecommitdiff
path: root/openbox/keyboard.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-05-02 03:10:25 +0000
committerDana Jansens <danakj@orodu.net>2007-05-02 03:10:25 +0000
commita6f52b90551621316a36f7cd7b20ef1d5dca0782 (patch)
tree4e36ca9ab824441be3e1453893ff856924bed898 /openbox/keyboard.c
parentcb030c6f3a6f464cacd46d970ab28c532df84104 (diff)
better menu keyboard handling.
also, when you hit a keybinding while menus are open, it will close the menus and run the binding.
Diffstat (limited to 'openbox/keyboard.c')
-rw-r--r--openbox/keyboard.c5
1 files changed, 5 insertions, 0 deletions
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 */