summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsabetts <sabetts>2001-03-14 08:15:07 +0000
committersabetts <sabetts>2001-03-14 08:15:07 +0000
commita777e8317fb0087d75498a7d61ce80ac2caea8a1 (patch)
tree1164d76ee55fbbf9676e15fdd94c7c6df0c687b2
parent270248e519533aa5d99f3ff4acdf613d6798546e (diff)
downloadratpoison-a777e8317fb0087d75498a7d61ce80ac2caea8a1.zip
* src/events.c (delegate_event): calls focus_change on FocusOut
and FocusIn events. (focus_change): new function * src/list.c (add_to_window_list): add FocusChangeMask to the window's event mask.
-rw-r--r--ChangeLog9
-rw-r--r--src/events.c25
-rw-r--r--src/list.c3
3 files changed, 33 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 7a7779a..2e536c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-03-14 shawn <sabetts@diggin.lamenet.tmp>
+
+ * src/events.c (delegate_event): calls focus_change on FocusOut
+ and FocusIn events.
+ (focus_change): new function
+
+ * src/list.c (add_to_window_list): add FocusChangeMask to the
+ window's event mask.
+
2001-03-13 shawn <sabetts@diggin.lamenet.tmp>
* configure.in: warn the user if the x terminal emulator cannot be
diff --git a/src/events.c b/src/events.c
index 5043122..ee858d0 100644
--- a/src/events.c
+++ b/src/events.c
@@ -438,6 +438,23 @@ colormap_notify (XEvent *ev)
}
}
+static void
+focus_change (XFocusChangeEvent *ev)
+{
+ rp_window *win;
+
+ /* We're only interested in the NotifyGrab mode */
+ if (ev->mode != NotifyGrab) return;
+
+ win = find_window (ev->window);
+
+ if (win != NULL)
+ {
+ PRINT_DEBUG ("Re-grabbing prefix key\n");
+ grab_prefix_key (win->w);
+ }
+}
+
/* Given an event, call the correct function to handle it. */
void
delegate_event (XEvent *ev)
@@ -486,9 +503,6 @@ delegate_event (XEvent *ev)
case ReparentNotify:
PRINT_DEBUG ("ReparentNotify\n");
break;
- case FocusIn:
- PRINT_DEBUG ("FocusIn\n");
- break;
case MapRequest:
PRINT_DEBUG ("MapRequest\n");
@@ -518,6 +532,11 @@ delegate_event (XEvent *ev)
break;
case FocusOut:
PRINT_DEBUG ("FocusOut\n");
+ focus_change (&ev->xfocus);
+ break;
+ case FocusIn:
+ PRINT_DEBUG ("FocusIn\n");
+ focus_change (&ev->xfocus);
break;
case ConfigureNotify:
PRINT_DEBUG ("ConfigureNotify\n");
diff --git a/src/list.c b/src/list.c
index 2192b1e..9bf67d5 100644
--- a/src/list.c
+++ b/src/list.c
@@ -63,7 +63,8 @@ add_to_window_list (screen_info *s, Window w)
get_mouse_root_position (new_window, &new_window->mouse_x, &new_window->mouse_y);
- XSelectInput (dpy, new_window->w, PropertyChangeMask | ColormapChangeMask);
+ XSelectInput (dpy, new_window->w,
+ PropertyChangeMask | ColormapChangeMask | FocusChangeMask);
new_window->name = xmalloc (strlen ("Unnamed") + 1);