summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 91ec293..e699cd1 100644
--- a/src/main.c
+++ b/src/main.c
@@ -500,7 +500,12 @@ main (int argc, char *argv[])
/* Indicate to the user that ratpoison has booted. */
show_welcome_message();
-
+
+ /* If no window has focus, give the key_window focus. */
+ if (current_window() == NULL)
+ XSetInputFocus (dpy, current_screen()->key_window,
+ RevertToPointerRoot, CurrentTime);
+
handle_events ();
return EXIT_SUCCESS;
@@ -522,8 +527,7 @@ init_screen (screen_info *s, int screen_num)
it, terminating ratpoison. */
XSelectInput(dpy, RootWindow (dpy, screen_num),
PropertyChangeMask | ColormapChangeMask
- | SubstructureRedirectMask | KeyPressMask | KeyReleaseMask
- | SubstructureNotifyMask );
+ | SubstructureRedirectMask | SubstructureNotifyMask );
XSync (dpy, False);
s->screen_num = screen_num;