aboutsummaryrefslogtreecommitdiff
path: root/xwayland
diff options
context:
space:
mode:
authorWolf480pl <wolf480@interia.pl>2018-10-12 23:53:21 +0200
committerWolf480pl <wolf480@interia.pl>2018-10-13 00:20:22 +0200
commit3512db3ded997de8339602f1bc514965442a870d (patch)
tree6a4c6ee53ea0f9020cb932cbfc99c19233426f16 /xwayland
parent4897267bd6b16ae9caeae5d4ac5d661e60230840 (diff)
xwayland/xwm: make hints->input default to true
An X11 client can leave the hints->input WM hint unspecified, by not setting the XCB_ICCCM_WM_HINT_INPUT flag in hints->flags. In that case, we should assume a sane default. Make the hint default to true, so that clients which do not specify the hint, like mupdf, still get keyboard focus. This should fix swaywm/sway#2231
Diffstat (limited to 'xwayland')
-rw-r--r--xwayland/xwm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xwayland/xwm.c b/xwayland/xwm.c
index 1fb6f331..fce61f6b 100644
--- a/xwayland/xwm.c
+++ b/xwayland/xwm.c
@@ -522,6 +522,12 @@ static void read_surface_hints(struct wlr_xwm *xwm,
memcpy(xsurface->hints, &hints, sizeof(struct wlr_xwayland_surface_hints));
xsurface->hints_urgency = xcb_icccm_wm_hints_get_urgency(&hints);
+ if (!(xsurface->hints->flags & XCB_ICCCM_WM_HINT_INPUT)) {
+ // The client didn't specify whether it wants input.
+ // Assume it does.
+ xsurface->hints->input = true;
+ }
+
wlr_log(WLR_DEBUG, "WM_HINTS (%d)", reply->value_len);
wlr_signal_emit_safe(&xsurface->events.set_hints, xsurface);
}