X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fkeyboard.c;h=5f7531e39d7f35acb7019cbd8e4fb80359519467;hb=3bd4397b6ec5212bfe53a36892746962dc45dbeb;hp=5ac423639c35628036133ece70dc9279ac94770a;hpb=26cc41f6c6187dabd5c7ee4365c8fa44751009e5;p=chaz%2Fopenbox diff --git a/openbox/keyboard.c b/openbox/keyboard.c index 5ac42363..5f7531e3 100644 --- a/openbox/keyboard.c +++ b/openbox/keyboard.c @@ -51,13 +51,13 @@ static void grab_keys(gboolean grab) while (p) { if (p->key) grab_key(p->key, p->state, obt_root(ob_screen), - GrabModeSync); + GrabModeAsync); p = p->next_sibling; } if (curpos) grab_key(config_keyboard_reset_keycode, config_keyboard_reset_state, - obt_root(ob_screen), GrabModeSync); + obt_root(ob_screen), GrabModeAsync); } } @@ -89,7 +89,7 @@ static void set_curpos(KeyBindingTree *newpos) g_free(oldtext); } - a = screen_physical_area_active(); + a = screen_physical_area_primary(FALSE); popup_position(popup, NorthWestGravity, a->x + 10, a->y + 10); /* 1 second delay for the popup to show */ popup_delay_show(popup, G_USEC_PER_SEC, text); @@ -204,13 +204,14 @@ gboolean keyboard_process_interactive_grab(const XEvent *e, ObClient **client) } #endif -void keyboard_event(ObClient *client, const XEvent *e) +gboolean keyboard_event(ObClient *client, const XEvent *e) { KeyBindingTree *p; + gboolean used; if (e->type == KeyRelease) { grab_key_passive_count(-1); - return; + return FALSE; } g_assert(e->type == KeyPress); @@ -221,9 +222,10 @@ void keyboard_event(ObClient *client, const XEvent *e) { obt_main_loop_timeout_remove(ob_main_loop, chain_timeout); keyboard_reset_chains(-1); - return; + return TRUE; } + used = FALSE; if (curpos == NULL) p = keyboard_firstnode; else @@ -258,11 +260,11 @@ void keyboard_event(ObClient *client, const XEvent *e) 0, OB_FRAME_CONTEXT_NONE, client); } break; + used = TRUE; } p = p->next_sibling; } - - XAllowEvents(obt_display, AsyncKeyboard, event_curtime); + return used; } static void node_rebind(KeyBindingTree *node) @@ -324,4 +326,3 @@ void keyboard_shutdown(gboolean reconfig) popup_free(popup); popup = NULL; } -