Add keyboard shortcuts inhibitor ipc subscription

Add a new type of ipc subscription so clients can be notified of changes
in keyboard shortcuts inhibitors. This allows to react to those events
by e.g. changing container properties (title, ...) to notify the user
about this circumstance (add marker, change color, ...). For this reason
the event includes information about the affected container as well.

Signed-off-by: Michael Weiser <michael.weiser@gmx.de>
This commit is contained in:
Michael Weiser 2021-04-15 20:35:42 +02:00
parent d48c2998e3
commit b6c689c72e
8 changed files with 58 additions and 1 deletions

View file

@ -37,6 +37,7 @@ enum ipc_command_type {
IPC_EVENT_BAR_STATE_UPDATE = ((1<<31) | 20),
IPC_EVENT_INPUT = ((1<<31) | 21),
IPC_EVENT_IDLE_INHIBITOR = ((1<<31) | 22),
IPC_EVENT_KEYBOARD_SHORTCUTS_INHIBITOR = ((1<<31) | 23),
};
#endif

View file

@ -5,6 +5,7 @@
#include "sway/tree/container.h"
#include "sway/desktop/idle_inhibit_v1.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/tree/container.h"
json_object *ipc_json_get_version(void);
@ -20,5 +21,7 @@ json_object *ipc_json_describe_seat(struct sway_seat *seat);
json_object *ipc_json_describe_bar_config(struct bar_config *bar);
json_object *ipc_json_describe_idle_inhibitor(
struct sway_idle_inhibitor_v1 *sway_inhibitor);
json_object *ipc_json_describe_keyboard_shortcuts_inhibitor(
struct sway_keyboard_shortcuts_inhibitor *sway_inhibitor);
#endif

View file

@ -4,6 +4,7 @@
#include "sway/config.h"
#include "sway/desktop/idle_inhibit_v1.h"
#include "sway/input/input-manager.h"
#include "sway/input/seat.h"
#include "sway/tree/container.h"
#include "ipc.h"
@ -24,5 +25,8 @@ void ipc_event_binding(struct sway_binding *binding);
void ipc_event_input(const char *change, struct sway_input_device *device);
void ipc_event_output(void);
void ipc_event_idle_inhibitor(struct sway_idle_inhibitor_v1 *inhibitor, const char *change);
void ipc_event_keyboard_shortcuts_inhibitor(
struct sway_keyboard_shortcuts_inhibitor *inhibitor,
const char *change);
#endif