This commit is contained in:
Michael Weiser 2024-03-22 15:39:35 +00:00 committed by GitHub
commit 180500867c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 178 additions and 2 deletions

View file

@ -36,6 +36,8 @@ enum ipc_command_type {
// sway-specific event types
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

@ -39,6 +39,10 @@ struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_user_inhibitor_for_view(
struct sway_idle_inhibitor_v1 *sway_idle_inhibit_v1_application_inhibitor_for_view(
struct sway_view *view);
void sway_idle_inhibit_v1_user_inhibitor_update_mode(
struct sway_idle_inhibitor_v1 *inhibitor,
enum sway_idle_inhibit_mode mode);
void sway_idle_inhibit_v1_user_inhibitor_destroy(
struct sway_idle_inhibitor_v1 *inhibitor);

View file

@ -369,4 +369,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

View file

@ -3,7 +3,10 @@
#include <json.h>
#include "sway/output.h"
#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);
@ -16,5 +19,9 @@ json_object *ipc_json_describe_node_recursive(struct sway_node *node);
json_object *ipc_json_describe_input(struct sway_input_device *device);
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

@ -2,7 +2,9 @@
#define _SWAY_IPC_SERVER_H
#include <sys/socket.h>
#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"
@ -22,5 +24,9 @@ void ipc_event_shutdown(const char *reason);
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