From d6649a8a4ba19fda25fe8607bc62acea8acb5fed Mon Sep 17 00:00:00 2001 From: BrassyPanache Date: Wed, 13 Jan 2021 01:10:38 +1100 Subject: Expose ICCCM input status In certain situations windows can have their input field set to false but still expect to receive input focus by passively listening to key presses via a parent window. The ICCCM specification outlines how focus should be given to clients. Further reading: https://tronche.com/gui/x/icccm/sec-4.html#s-4.1.7 Relates to #2604 --- include/wlr/xwayland.h | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h index fd14ff25..7dcb3935 100644 --- a/include/wlr/xwayland.h +++ b/include/wlr/xwayland.h @@ -119,6 +119,18 @@ struct wlr_xwayland_surface_size_hints { uint32_t win_gravity; }; +/** + * This represents the input focus described as follows: + * + * https://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/ICCCM/icccm.html#input_focus + */ +enum wlr_xwayland_icccm_input_model { + WLR_ICCCM_INPUT_MODEL_NONE = 0, + WLR_ICCCM_INPUT_MODEL_PASSIVE = 1, + WLR_ICCCM_INPUT_MODEL_LOCAL = 2, + WLR_ICCCM_INPUT_MODEL_GLOBAL = 3, +}; + /** * An Xwayland user interface component. It has an absolute position in * layout-local coordinates. @@ -303,7 +315,10 @@ void wlr_xwayland_surface_ping(struct wlr_xwayland_surface *surface); * false if it should be ignored */ bool wlr_xwayland_or_surface_wants_focus( - const struct wlr_xwayland_surface *surface); + const struct wlr_xwayland_surface *xsurface); + +enum wlr_xwayland_icccm_input_model wlr_xwayland_icccm_input_model( + const struct wlr_xwayland_surface *xsurface); #endif -- cgit v1.2.3