|
|
@ -538,8 +538,24 @@ 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 wlr_seat_pointer_notify_button(struct wlr_seat *wlr_seat,
|
|
|
|
uint32_t time, uint32_t button, uint32_t state) {
|
|
|
|
uint32_t time, uint32_t button, uint32_t state) {
|
|
|
|
|
|
|
|
if (state == WL_POINTER_BUTTON_STATE_PRESSED) {
|
|
|
|
|
|
|
|
if (wlr_seat->pointer_state.button_count == 0) {
|
|
|
|
|
|
|
|
wlr_seat->pointer_state.grab_button = button;
|
|
|
|
|
|
|
|
wlr_seat->pointer_state.grab_time = time;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
wlr_seat->pointer_state.button_count++;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
wlr_seat->pointer_state.button_count--;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
|
|
|
|
struct wlr_seat_pointer_grab *grab = wlr_seat->pointer_state.grab;
|
|
|
|
return grab->interface->button(grab, time, button, state);
|
|
|
|
uint32_t serial = grab->interface->button(grab, time, button, state);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (wlr_seat->pointer_state.button_count == 1) {
|
|
|
|
|
|
|
|
wlr_seat->pointer_state.grab_serial = serial;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return serial;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time,
|
|
|
|
void wlr_seat_pointer_notify_axis(struct wlr_seat *wlr_seat, uint32_t time,
|
|
|
|