From 7f7db7d9a35928480ff2f7ef77147ee48a35dc14 Mon Sep 17 00:00:00 2001 From: sabetts Date: Sun, 9 Sep 2001 20:08:22 +0000 Subject: * 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. --- ChangeLog | 9 +++++++++ src/main.c | 10 +++++++--- src/split.c | 9 +++++++-- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c561f5f..b007a8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2001-09-09 shawn + * 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. 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; 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 -- cgit v1.2.3