xwayland: assume no WM_HINTS means window wants input

Some X11 clients (e.g. Chromium, sxiv) don't set WM_HINTS. The spec
says:

> Window managers are free to assume convenient values for all fields of the
> WM_HINTS property if a window is mapped without one.

Our wlr_xwayland_icccm_input_model function assumes missing WM_HINTS
means the window doesn't want input, but this is incorrect. Assume the
window wants input unless it explicitly opts-out by setting WM_HINTS.

Closes: https://github.com/swaywm/sway/issues/6107
This commit is contained in:
Simon Ser 2021-03-29 11:57:31 +02:00 committed by Kenny Levinsen
parent b89bcffea4
commit 96aa18ae44

View file

@ -2024,7 +2024,7 @@ enum wlr_xwayland_icccm_input_model wlr_xwayland_icccm_input_model(
xsurface->protocols, xsurface->protocols_len,
WM_TAKE_FOCUS);
if (xsurface->hints && xsurface->hints->input) {
if (!xsurface->hints || xsurface->hints->input) {
if (take_focus) {
return WLR_ICCCM_INPUT_MODEL_LOCAL;
}