summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-09-09 20:08:22 +0000
committersabetts <sabetts>2001-09-09 20:08:22 +0000
commit7f7db7d9a35928480ff2f7ef77147ee48a35dc14 (patch)
tree9182c6a71d30ecb6350b4043c5a3e1e0e3cf30dc /src
parent29fc0a0b61524c858128dd5cc25d797182dd8a36 (diff)
downloadratpoison-7f7db7d9a35928480ff2f7ef77147ee48a35dc14.zip
* 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.
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
-rw-r--r--src/split.c9
2 files changed, 14 insertions, 5 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;
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