From fb2493115fd152e0f2247935eed1cbaca2f0ba6d Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Tue, 24 Apr 2007 21:45:43 +0000 Subject: [PATCH] only grab keybinds on the root window, not every client window --- openbox/client.c | 2 -- openbox/event.c | 2 +- openbox/keyboard.c | 8 +------- openbox/keyboard.h | 2 -- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 51e93c17..ac500e31 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -374,7 +374,6 @@ void client_manage(Window window) self->window, newx, newy, self->area.width, self->area.height); client_apply_startup_state(self, newx, newy); - keyboard_grab_for_client(self, TRUE); mouse_grab_for_client(self, TRUE); if (activate) { @@ -490,7 +489,6 @@ void client_unmanage(ObClient *self) event_ignore_queued_enters(); } - keyboard_grab_for_client(self, FALSE); mouse_grab_for_client(self, FALSE); /* remove the window from our save set */ diff --git a/openbox/event.c b/openbox/event.c index c3fab03e..788fd4bc 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -589,7 +589,7 @@ static void event_process(const XEvent *ec, gpointer data) mouse_event(client, e); } else if (e->type == KeyPress) { keyboard_event((focus_cycle_target ? focus_cycle_target : - client), e); + (client ? client : focus_client)), e); } } } diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 71164ac3..6adb0aa9 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -68,18 +68,12 @@ static void grab_for_window(Window win, gboolean grab) } } -void keyboard_grab_for_client(ObClient *c, gboolean grab) -{ - grab_for_window(c->window, grab); -} - static void grab_keys(gboolean grab) { GList *it; grab_for_window(screen_support_win, grab); - for (it = client_list; it; it = g_list_next(it)) - grab_for_window(((ObClient*)it->data)->window, grab); + grab_for_window(RootWindow(ob_display, ob_screen), grab); } static gboolean chain_timeout(gpointer data) diff --git a/openbox/keyboard.h b/openbox/keyboard.h index 23b93684..80709fa5 100644 --- a/openbox/keyboard.h +++ b/openbox/keyboard.h @@ -46,6 +46,4 @@ 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); - #endif -- 2.45.2