From 405d9a3e431b01a221be65f41bccb6c80c43b0a4 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 11 Jan 2008 21:19:58 -0500 Subject: dont reparse the config file when the keyboard map changes. just rebind everything. yay for mika as inspiration --- openbox/keyboard.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'openbox/keyboard.c') diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 0aade9ab..eddda577 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -51,8 +51,9 @@ static void grab_keys(gboolean grab) if (grab) { p = curpos ? curpos->first_child : keyboard_firstnode; while (p) { - grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), - GrabModeAsync); + if (p->key) + grab_key(p->key, p->state, RootWindow(ob_display, ob_screen), + GrabModeAsync); p = p->next_sibling; } if (curpos) @@ -264,6 +265,12 @@ void keyboard_event(ObClient *client, const XEvent *e) } } +void keyboard_rebind() +{ + tree_rebind(keyboard_firstnode); + grab_keys(TRUE); +} + void keyboard_startup(gboolean reconfig) { grab_keys(TRUE); -- cgit v1.2.3