aboutsummaryrefslogtreecommitdiff
path: root/backend
diff options
context:
space:
mode:
authorIsaac Freund <ifreund@ifreund.xyz>2020-10-21 17:21:23 +0200
committerSimon Ser <contact@emersion.fr>2020-11-11 10:58:38 +0100
commit7693f61d813869f7f8b3c658f610a16f6283b24f (patch)
treeab5df7c5da7bf1108eae9a2df6b248994ac5ee38 /backend
parent238d1c078fb03338e9f271d98f7bf6b1fc399285 (diff)
Replace wlr_key_state with wl_keyboard_key_state
There's no reason to have duplicate enums
Diffstat (limited to 'backend')
-rw-r--r--backend/libinput/keyboard.c4
-rw-r--r--backend/wayland/seat.c4
-rw-r--r--backend/x11/input_device.c8
3 files changed, 9 insertions, 7 deletions
diff --git a/backend/libinput/keyboard.c b/backend/libinput/keyboard.c
index 93605e77..d5207f54 100644
--- a/backend/libinput/keyboard.c
+++ b/backend/libinput/keyboard.c
@@ -72,10 +72,10 @@ void handle_keyboard_key(struct libinput_event *event,
libinput_event_keyboard_get_key_state(kbevent);
switch (state) {
case LIBINPUT_KEY_STATE_RELEASED:
- wlr_event.state = WLR_KEY_RELEASED;
+ wlr_event.state = WL_KEYBOARD_KEY_STATE_RELEASED;
break;
case LIBINPUT_KEY_STATE_PRESSED:
- wlr_event.state = WLR_KEY_PRESSED;
+ wlr_event.state = WL_KEYBOARD_KEY_STATE_PRESSED;
break;
}
wlr_event.update_state = true;
diff --git a/backend/wayland/seat.c b/backend/wayland/seat.c
index 1697616c..c1cd473d 100644
--- a/backend/wayland/seat.c
+++ b/backend/wayland/seat.c
@@ -209,7 +209,7 @@ static void keyboard_handle_enter(void *data, struct wl_keyboard *wl_keyboard,
wl_array_for_each(keycode_ptr, keys) {
struct wlr_event_keyboard_key event = {
.keycode = *keycode_ptr,
- .state = WLR_KEY_PRESSED,
+ .state = WL_KEYBOARD_KEY_STATE_PRESSED,
.time_msec = time,
.update_state = false,
};
@@ -232,7 +232,7 @@ static void keyboard_handle_leave(void *data, struct wl_keyboard *wl_keyboard,
struct wlr_event_keyboard_key event = {
.keycode = keycode,
- .state = WLR_KEY_RELEASED,
+ .state = WL_KEYBOARD_KEY_STATE_RELEASED,
.time_msec = time,
.update_state = false,
};
diff --git a/backend/x11/input_device.c b/backend/x11/input_device.c
index ced52bae..1bcd3060 100644
--- a/backend/x11/input_device.c
+++ b/backend/x11/input_device.c
@@ -4,6 +4,8 @@
#include <linux/input-event-codes.h>
+#include <wayland-server-protocol.h>
+
#include <xcb/xcb.h>
#include <xcb/xfixes.h>
#include <xcb/xinput.h>
@@ -18,7 +20,7 @@
#include "util/signal.h"
static void send_key_event(struct wlr_x11_backend *x11, uint32_t key,
- enum wlr_key_state st, xcb_timestamp_t time) {
+ enum wl_keyboard_key_state st, xcb_timestamp_t time) {
struct wlr_event_keyboard_key ev = {
.time_msec = time,
.keycode = key,
@@ -123,7 +125,7 @@ void handle_x11_xinput_event(struct wlr_x11_backend *x11,
wlr_keyboard_notify_modifiers(&x11->keyboard, ev->mods.base,
ev->mods.latched, ev->mods.locked, ev->mods.effective);
- send_key_event(x11, ev->detail - 8, WLR_KEY_PRESSED, ev->time);
+ send_key_event(x11, ev->detail - 8, WL_KEYBOARD_KEY_STATE_PRESSED, ev->time);
x11->time = ev->time;
break;
}
@@ -133,7 +135,7 @@ void handle_x11_xinput_event(struct wlr_x11_backend *x11,
wlr_keyboard_notify_modifiers(&x11->keyboard, ev->mods.base,
ev->mods.latched, ev->mods.locked, ev->mods.effective);
- send_key_event(x11, ev->detail - 8, WLR_KEY_RELEASED, ev->time);
+ send_key_event(x11, ev->detail - 8, WL_KEYBOARD_KEY_STATE_RELEASED, ev->time);
x11->time = ev->time;
break;
}