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
This commit is contained in:
BrassyPanache 2021-01-13 01:10:38 +11:00 committed by Simon Ser
parent f6fe439718
commit d6649a8a4b
2 changed files with 42 additions and 7 deletions

View file

@ -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