aboutsummaryrefslogtreecommitdiff
path: root/rootston/virtual_keyboard.c
diff options
context:
space:
mode:
authorDorota Czaplejewicz <dorota.czaplejewicz@puri.sm>2018-05-24 19:46:54 +0200
committerDorota Czaplejewicz <dorota.czaplejewicz@puri.sm>2018-05-28 10:05:55 +0200
commit5334ee8bfd93b2bfdc077f422b87c2509f04d5d4 (patch)
tree1aae3d296d80cab3d8cf7cb45c0ceb873a8c115b /rootston/virtual_keyboard.c
parenta94c56a828933d72b0529f81916292222ef152f0 (diff)
virtual-keyboard: add support for the virtual-keyboard-v1 protocol
Diffstat (limited to 'rootston/virtual_keyboard.c')
-rw-r--r--rootston/virtual_keyboard.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/rootston/virtual_keyboard.c b/rootston/virtual_keyboard.c
new file mode 100644
index 00000000..db47efca
--- /dev/null
+++ b/rootston/virtual_keyboard.c
@@ -0,0 +1,21 @@
+#define _POSIX_C_SOURCE 199309L
+
+#include <wlr/util/log.h>
+#include <wlr/types/wlr_virtual_keyboard_v1.h>
+#include "rootston/virtual_keyboard.h"
+#include "rootston/seat.h"
+
+void handle_virtual_keyboard(struct wl_listener *listener, void *data) {
+ struct roots_desktop *desktop =
+ wl_container_of(listener, desktop, virtual_keyboard_new);
+ struct wlr_virtual_keyboard_v1 *keyboard = data;
+
+ struct roots_seat *seat = input_seat_from_wlr_seat(desktop->server->input,
+ keyboard->seat);
+ if (!seat) {
+ wlr_log(L_ERROR, "could not find roots seat");
+ return;
+ }
+
+ roots_seat_add_device(seat, &keyboard->input_device);
+}