pointer: use enum wl_pointer_button_state

This commit is contained in:
Simon Ser 2024-02-28 10:26:38 +01:00 committed by Simon Zeni
parent 9f4cf242d9
commit 812451cd8f
8 changed files with 21 additions and 21 deletions

View file

@ -23,7 +23,7 @@ static void default_pointer_motion(struct wlr_seat_pointer_grab *grab,
}
static uint32_t default_pointer_button(struct wlr_seat_pointer_grab *grab,
uint32_t time, uint32_t button, enum wlr_button_state state) {
uint32_t time, uint32_t button, enum wl_pointer_button_state state) {
return wlr_seat_pointer_send_button(grab->seat, time, button, state);
}
@ -260,7 +260,7 @@ void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time,
}
uint32_t wlr_seat_pointer_send_button(struct wlr_seat *wlr_seat, uint32_t time,
uint32_t button, enum wlr_button_state state) {
uint32_t button, enum wl_pointer_button_state state) {
struct wlr_seat_client *client = wlr_seat->pointer_state.focused_client;
if (client == NULL) {
return 0;
@ -453,12 +453,12 @@ void wlr_seat_pointer_notify_motion(struct wlr_seat *wlr_seat, uint32_t time,
}
uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
uint32_t time, uint32_t button, enum wlr_button_state state) {
uint32_t time, uint32_t button, enum wl_pointer_button_state state) {
clock_gettime(CLOCK_MONOTONIC, &wlr_seat->last_event);
struct wlr_seat_pointer_state* pointer_state = &wlr_seat->pointer_state;
if (state == WLR_BUTTON_PRESSED) {
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
if (pointer_state->button_count == 0) {
pointer_state->grab_button = button;
pointer_state->grab_time = time;
@ -475,7 +475,7 @@ uint32_t wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
uint32_t serial = grab->interface->button(grab, time, button, state);
if (serial && pointer_state->button_count == 1 &&
state == WLR_BUTTON_PRESSED) {
state == WL_POINTER_BUTTON_STATE_PRESSED) {
pointer_state->grab_serial = serial;
}

View file

@ -71,7 +71,7 @@ static void virtual_pointer_button(struct wl_client *client,
.pointer = &pointer->pointer,
.time_msec = time,
.button = button,
.state = state ? WLR_BUTTON_PRESSED : WLR_BUTTON_RELEASED
.state = state ? WL_POINTER_BUTTON_STATE_PRESSED : WL_POINTER_BUTTON_STATE_RELEASED,
};
wl_signal_emit_mutable(&pointer->pointer.events.button, &event);
}