Add keyboard shortcuts inhibitors to ipc json output

Extend the container description in IPC JSON to include keyboard
shortcut inhibitor state so it can be evaluated by clients. This
requires adding a new function that can retrieve a keyboard shortcuts
inhibitor applying to a specific surface no matter what seat it is
attached to.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
This commit is contained in:
Michael Weiser 2021-04-18 00:10:31 +02:00
parent f7a0f06dff
commit 0b7ee0b4a6
3 changed files with 42 additions and 0 deletions

View file

@ -368,4 +368,12 @@ keyboard_shortcuts_inhibitor_get_for_surface(const struct sway_seat *seat,
struct sway_keyboard_shortcuts_inhibitor *
keyboard_shortcuts_inhibitor_get_for_focused_surface(const struct sway_seat *seat);
/**
* Returns the keyboard shortcuts inhibitor that applies to the given surface
* or NULL if none exists. It looks at inhibitors attached to all seats.
*/
struct sway_keyboard_shortcuts_inhibitor *
keyboard_shortcuts_inhibitor_get_for_surface_on_any_seat(
const struct wlr_surface *surface);
#endif