summaryrefslogtreecommitdiff
path: root/src/xwindow.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2017-10-05 16:54:38 -0700
committerVito Caputo <vcaputo@pengaru.com>2017-10-05 16:54:38 -0700
commit55e7b6fa5bbb84dc8f2689ff674b27706ffe5ef3 (patch)
tree1d152a7fa0c7f09fd0652f8f9720393d9ebbee3f /src/xwindow.c
parent7096b3b6c1325630d18e5d61aac58f9c3772b8e1 (diff)
*: handle FocusIn events
Some programs call XSetInputFocus(), so we should select FocusChangeEvent and handle FocusIn events, calling vwm_win_set_focus() when appropriate. It's rare, but SDL2 programs in particular seem to do this and vwm gets in a pretty annoying state when it does occur. This change should improve the situation.
Diffstat (limited to 'src/xwindow.c')
-rw-r--r--src/xwindow.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xwindow.c b/src/xwindow.c
index 1aa4f71..6fc9691 100644
--- a/src/xwindow.c
+++ b/src/xwindow.c
@@ -159,8 +159,10 @@ vwm_xwindow_t * vwm_xwin_create(vwm_t *vwm, Window win, vwm_grab_mode_t grabbed)
XFetchName(VWM_XDISPLAY(vwm), win, &xwin->name);
/* This is so we get the PropertyNotify event and can get the pid when it's set post-create,
- * with my _NET_WM_PID patch the property is immediately available */
- XSelectInput(VWM_XDISPLAY(vwm), win, PropertyChangeMask);
+ * with my _NET_WM_PID patch the property is immediately available.
+ * FocusChangeMask is needed to notice when clients call XSetInputFocus().
+ */
+ XSelectInput(VWM_XDISPLAY(vwm), win, PropertyChangeMask | FocusChangeMask);
/* we must track the mapped-by-client state of the window independent of managed vs. unmanaged because
* in the case of override_redirect windows they may be unmapped (invisible) or mapped (visible) like menus without being managed.
© All Rights Reserved