diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2019-07-17 17:12:20 -0400 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2019-07-23 20:45:46 +0300 |
commit | 6effca7b61e87c7d17885d007d94e556a0137651 (patch) | |
tree | 686cc1e219d8236f8c9864c9992b3cb6b44c9583 /sway/input/input-manager.c | |
parent | input_cmd_xkb_switch_layout: support input types (diff) | |
download | sway-6effca7b61e87c7d17885d007d94e556a0137651.tar.gz sway-6effca7b61e87c7d17885d007d94e556a0137651.tar.zst sway-6effca7b61e87c7d17885d007d94e556a0137651.zip |
ipc: add an input event
This adds an ipc event related to input devices. Currently the
following changes are supported:
- added: when an input device becomes available
- removed: when an input device is no longer available
- xkb_keymap_changed: (keyboards only) the keymap changed
- xkb_layout_changed: (keyboards only) the effective layout changed
Diffstat (limited to 'sway/input/input-manager.c')
-rw-r--r-- | sway/input/input-manager.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sway/input/input-manager.c b/sway/input/input-manager.c index 4fd980c4..dd84a0b3 100644 --- a/sway/input/input-manager.c +++ b/sway/input/input-manager.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include "sway/config.h" | 12 | #include "sway/config.h" |
13 | #include "sway/input/input-manager.h" | 13 | #include "sway/input/input-manager.h" |
14 | #include "sway/input/seat.h" | 14 | #include "sway/input/seat.h" |
15 | #include "sway/ipc-server.h" | ||
15 | #include "sway/server.h" | 16 | #include "sway/server.h" |
16 | #include "stringop.h" | 17 | #include "stringop.h" |
17 | #include "list.h" | 18 | #include "list.h" |
@@ -584,6 +585,8 @@ static void handle_device_destroy(struct wl_listener *listener, void *data) { | |||
584 | seat_remove_device(seat, input_device); | 585 | seat_remove_device(seat, input_device); |
585 | } | 586 | } |
586 | 587 | ||
588 | ipc_event_input("removed", input_device); | ||
589 | |||
587 | wl_list_remove(&input_device->link); | 590 | wl_list_remove(&input_device->link); |
588 | wl_list_remove(&input_device->device_destroy.link); | 591 | wl_list_remove(&input_device->device_destroy.link); |
589 | free(input_device->identifier); | 592 | free(input_device->identifier); |
@@ -656,6 +659,8 @@ static void handle_new_input(struct wl_listener *listener, void *data) { | |||
656 | "device '%s' is not configured on any seats", | 659 | "device '%s' is not configured on any seats", |
657 | input_device->identifier); | 660 | input_device->identifier); |
658 | } | 661 | } |
662 | |||
663 | ipc_event_input("added", input_device); | ||
659 | } | 664 | } |
660 | 665 | ||
661 | static void handle_inhibit_activate(struct wl_listener *listener, void *data) { | 666 | static void handle_inhibit_activate(struct wl_listener *listener, void *data) { |