diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/main.c | 10 | ||||
-rw-r--r-- | src/split.c | 9 |
3 files changed, 23 insertions, 5 deletions
@@ -1,5 +1,14 @@ 2001-09-09 shawn <sabetts@diggin.lamenet.tmp> + * src/split.c (set_active_frame): give the key_window focus when + no window has focus. + (blank_frame): give the key_window focus. + + * src/main.c (init_screen): don't listen for keystrokes on the + root window. + (main): give the key_window focus in the case that no window has + focus. + * src/bar.c (marked_message): use the screen_info fg_color and bg_color to create the inverse GC. @@ -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; diff --git a/src/split.c b/src/split.c index b915714..9fdeb66 100644 --- a/src/split.c +++ b/src/split.c @@ -529,11 +529,12 @@ set_active_frame (rp_window_frame *frame) show_frame_indicator(); } - /* If the frame has no window to give focus to, give the root window + /* If the frame has no window to give focus to, give the key window focus. */ if( !frame->win ) { - XSetInputFocus (dpy, PointerRoot, RevertToPointerRoot, CurrentTime); + XSetInputFocus (dpy, current_screen()->key_window, + RevertToPointerRoot, CurrentTime); } } @@ -546,6 +547,10 @@ blank_frame (rp_window_frame *frame) hide_others (frame->win); set_frames_window (frame, NULL); + + /* Give the key window focus. */ + XSetInputFocus (dpy, current_screen()->key_window, + RevertToPointerRoot, CurrentTime); } void |