summaryrefslogtreecommitdiff
path: root/src/events.c
diff options
context:
space:
mode:
authorsabetts <sabetts>2003-08-31 06:51:32 +0000
committersabetts <sabetts>2003-08-31 06:51:32 +0000
commit8122f90155b54a948bc062d496de373f891a43f6 (patch)
treef0ccbcde619d3db377ede191aa1458422f067a9b /src/events.c
parente62c770a1ea5d89bb91d9b84ac4a4593bc32ef71 (diff)
downloadratpoison-8122f90155b54a948bc062d496de373f891a43f6.zip
* src/input.c (get_more_input): use XGrabKeyboard and XUngrabKeyboard
for changing focus to read key presses. * src/events.c (handle_key): use XGrabKeyboard and XUngrabKeyboard for changing focus to read key presses. * src/actions.c (cmd_resize): use XGrabKeyboard and XUngrabKeyboard for changing focus to read key presses. (cmd_license): likewise (cmd_help): likewise (cmd_fselect): likewise
Diffstat (limited to 'src/events.c')
-rw-r--r--src/events.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/events.c b/src/events.c
index 666c8bf..0d69095 100644
--- a/src/events.c
+++ b/src/events.c
@@ -367,8 +367,6 @@ handle_key (rp_screen *s)
{
char *keysym_name;
rp_action *key_action;
- int revert;
- Window fwin; /* Window currently in focus */
KeySym keysym; /* Key pressed */
unsigned int mod; /* Modifiers */
int rat_grabbed = 0;
@@ -383,8 +381,7 @@ handle_key (rp_screen *s)
alarm (0);
alarm_signalled = 0;
- XGetInputFocus (dpy, &fwin, &revert);
- set_window_focus (s->key_window);
+ XGrabKeyboard (dpy, s->key_window, False, GrabModeSync, GrabModeAsync, CurrentTime);
/* Change the mouse icon to indicate to the user we are waiting for
more keystrokes */
@@ -398,8 +395,8 @@ handle_key (rp_screen *s)
hook_run (&rp_prefix_hook);
read_key (&keysym, &mod, NULL, 0);
+ XUngrabKeyboard (dpy, CurrentTime);
- set_window_focus (fwin);
if (rat_grabbed)
ungrab_rat();