mirror of
https://github.com/swaywm/sway.git
synced 2025-11-06 13:29:50 -05:00
ipc: add support for output event
For compatibility with i3 [1]. [1]: https://i3wm.org/docs/ipc.html#_output_event
This commit is contained in:
parent
2e33b0276f
commit
40eb29e7c5
4 changed files with 35 additions and 0 deletions
|
|
@ -508,6 +508,20 @@ void ipc_event_input(const char *change, struct sway_input_device *device) {
|
|||
json_object_put(json);
|
||||
}
|
||||
|
||||
void ipc_event_output(void) {
|
||||
if (!ipc_has_event_listeners(IPC_EVENT_OUTPUT)) {
|
||||
return;
|
||||
}
|
||||
sway_log(SWAY_DEBUG, "Sending output event");
|
||||
|
||||
json_object *json = json_object_new_object();
|
||||
json_object_object_add(json, "change", json_object_new_string("unspecified"));
|
||||
|
||||
const char *json_string = json_object_to_json_string(json);
|
||||
ipc_send_event(json_string, IPC_EVENT_OUTPUT);
|
||||
json_object_put(json);
|
||||
}
|
||||
|
||||
int ipc_client_handle_writable(int client_fd, uint32_t mask, void *data) {
|
||||
struct ipc_client *client = data;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue