sway/input: follow up wlroots input device events renaming

master
Simon Zeni 3 years ago committed by Kirill Primak
parent 49b3ac9a2c
commit 440d0bc22d

@ -112,7 +112,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
enum wlr_button_state state); enum wlr_button_state state);
void dispatch_cursor_axis(struct sway_cursor *cursor, void dispatch_cursor_axis(struct sway_cursor *cursor,
struct wlr_event_pointer_axis *event); struct wlr_pointer_axis_event *event);
void cursor_set_image(struct sway_cursor *cursor, const char *image, void cursor_set_image(struct sway_cursor *cursor, const char *image,
struct wl_client *client); struct wl_client *client);

@ -18,7 +18,7 @@ struct sway_seatop_impl {
enum wlr_button_state state); enum wlr_button_state state);
void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec); void (*pointer_motion)(struct sway_seat *seat, uint32_t time_msec);
void (*pointer_axis)(struct sway_seat *seat, void (*pointer_axis)(struct sway_seat *seat,
struct wlr_event_pointer_axis *event); struct wlr_pointer_axis_event *event);
void (*rebase)(struct sway_seat *seat, uint32_t time_msec); void (*rebase)(struct sway_seat *seat, uint32_t time_msec);
void (*tablet_tool_motion)(struct sway_seat *seat, void (*tablet_tool_motion)(struct sway_seat *seat,
struct sway_tablet_tool *tool, uint32_t time_msec); struct sway_tablet_tool *tool, uint32_t time_msec);
@ -274,7 +274,7 @@ void seatop_button(struct sway_seat *seat, uint32_t time_msec,
void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec); void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec);
void seatop_pointer_axis(struct sway_seat *seat, void seatop_pointer_axis(struct sway_seat *seat,
struct wlr_event_pointer_axis *event); struct wlr_pointer_axis_event *event);
void seatop_tablet_tool_tip(struct sway_seat *seat, void seatop_tablet_tool_tip(struct sway_seat *seat,
struct sway_tablet_tool *tool, uint32_t time_msec, struct sway_tablet_tool *tool, uint32_t time_msec,

@ -111,8 +111,8 @@ static struct cmd_results *press_or_release(struct sway_cursor *cursor,
: WLR_AXIS_ORIENTATION_HORIZONTAL; : WLR_AXIS_ORIENTATION_HORIZONTAL;
double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT) double delta = (button == SWAY_SCROLL_UP || button == SWAY_SCROLL_LEFT)
? -1 : 1; ? -1 : 1;
struct wlr_event_pointer_axis event = { struct wlr_pointer_axis_event event = {
.device = NULL, .pointer = NULL,
.time_msec = 0, .time_msec = 0,
.source = WLR_AXIS_SOURCE_WHEEL, .source = WLR_AXIS_SOURCE_WHEEL,
.orientation = orientation, .orientation = orientation,

@ -386,28 +386,29 @@ static void pointer_motion(struct sway_cursor *cursor, uint32_t time_msec,
static void handle_pointer_motion_relative( static void handle_pointer_motion_relative(
struct wl_listener *listener, void *data) { struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, motion); struct sway_cursor *cursor = wl_container_of(listener, cursor, motion);
struct wlr_event_pointer_motion *e = data; struct wlr_pointer_motion_event *e = data;
cursor_handle_activity_from_device(cursor, e->device); cursor_handle_activity_from_device(cursor, &e->pointer->base);
pointer_motion(cursor, e->time_msec, e->device, e->delta_x, e->delta_y, pointer_motion(cursor, e->time_msec, &e->pointer->base, e->delta_x,
e->unaccel_dx, e->unaccel_dy); e->delta_y, e->unaccel_dx, e->unaccel_dy);
} }
static void handle_pointer_motion_absolute( static void handle_pointer_motion_absolute(
struct wl_listener *listener, void *data) { struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = struct sway_cursor *cursor =
wl_container_of(listener, cursor, motion_absolute); wl_container_of(listener, cursor, motion_absolute);
struct wlr_event_pointer_motion_absolute *event = data; struct wlr_pointer_motion_absolute_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
double lx, ly; double lx, ly;
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, wlr_cursor_absolute_to_layout_coords(cursor->cursor, &event->pointer->base,
event->x, event->y, &lx, &ly); event->x, event->y, &lx, &ly);
double dx = lx - cursor->cursor->x; double dx = lx - cursor->cursor->x;
double dy = ly - cursor->cursor->y; double dy = ly - cursor->cursor->y;
pointer_motion(cursor, event->time_msec, event->device, dx, dy, dx, dy); pointer_motion(cursor, event->time_msec, &event->pointer->base, dx, dy,
dx, dy);
} }
void dispatch_cursor_button(struct sway_cursor *cursor, void dispatch_cursor_button(struct sway_cursor *cursor,
@ -422,7 +423,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor,
static void handle_pointer_button(struct wl_listener *listener, void *data) { static void handle_pointer_button(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, button); struct sway_cursor *cursor = wl_container_of(listener, cursor, button);
struct wlr_event_pointer_button *event = data; struct wlr_pointer_button_event *event = data;
if (event->state == WLR_BUTTON_PRESSED) { if (event->state == WLR_BUTTON_PRESSED) {
cursor->pressed_button_count++; cursor->pressed_button_count++;
@ -434,20 +435,20 @@ static void handle_pointer_button(struct wl_listener *listener, void *data) {
} }
} }
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
dispatch_cursor_button(cursor, event->device, dispatch_cursor_button(cursor, &event->pointer->base,
event->time_msec, event->button, event->state); event->time_msec, event->button, event->state);
} }
void dispatch_cursor_axis(struct sway_cursor *cursor, void dispatch_cursor_axis(struct sway_cursor *cursor,
struct wlr_event_pointer_axis *event) { struct wlr_pointer_axis_event *event) {
seatop_pointer_axis(cursor->seat, event); seatop_pointer_axis(cursor->seat, event);
} }
static void handle_pointer_axis(struct wl_listener *listener, void *data) { static void handle_pointer_axis(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, axis); struct sway_cursor *cursor = wl_container_of(listener, cursor, axis);
struct wlr_event_pointer_axis *event = data; struct wlr_pointer_axis_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
dispatch_cursor_axis(cursor, event); dispatch_cursor_axis(cursor, event);
} }
@ -458,8 +459,8 @@ static void handle_pointer_frame(struct wl_listener *listener, void *data) {
static void handle_touch_down(struct wl_listener *listener, void *data) { static void handle_touch_down(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down); struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_down);
struct wlr_event_touch_down *event = data; struct wlr_touch_down_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->touch->base);
cursor_hide(cursor); cursor_hide(cursor);
struct sway_seat *seat = cursor->seat; struct sway_seat *seat = cursor->seat;
@ -467,7 +468,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
struct wlr_surface *surface = NULL; struct wlr_surface *surface = NULL;
double lx, ly; double lx, ly;
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, wlr_cursor_absolute_to_layout_coords(cursor->cursor, &event->touch->base,
event->x, event->y, &lx, &ly); event->x, event->y, &lx, &ly);
double sx, sy; double sx, sy;
struct sway_node *focused_node = node_at_coords(seat, lx, ly, &surface, &sx, &sy); struct sway_node *focused_node = node_at_coords(seat, lx, ly, &surface, &sx, &sy);
@ -495,24 +496,25 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
double dx, dy; double dx, dy;
dx = lx - cursor->cursor->x; dx = lx - cursor->cursor->x;
dy = ly - cursor->cursor->y; dy = ly - cursor->cursor->y;
pointer_motion(cursor, event->time_msec, event->device, dx, dy, dx, dy); pointer_motion(cursor, event->time_msec, &event->touch->base, dx, dy,
dispatch_cursor_button(cursor, event->device, event->time_msec, dx, dy);
dispatch_cursor_button(cursor, &event->touch->base, event->time_msec,
BTN_LEFT, WLR_BUTTON_PRESSED); BTN_LEFT, WLR_BUTTON_PRESSED);
} }
} }
static void handle_touch_up(struct wl_listener *listener, void *data) { static void handle_touch_up(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_up); struct sway_cursor *cursor = wl_container_of(listener, cursor, touch_up);
struct wlr_event_touch_up *event = data; struct wlr_touch_up_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->touch->base);
struct wlr_seat *wlr_seat = cursor->seat->wlr_seat; struct wlr_seat *wlr_seat = cursor->seat->wlr_seat;
if (cursor->simulating_pointer_from_touch) { if (cursor->simulating_pointer_from_touch) {
if (cursor->pointer_touch_id == cursor->seat->touch_id) { if (cursor->pointer_touch_id == cursor->seat->touch_id) {
cursor->pointer_touch_up = true; cursor->pointer_touch_up = true;
dispatch_cursor_button(cursor, event->device, event->time_msec, dispatch_cursor_button(cursor, &event->touch->base,
BTN_LEFT, WLR_BUTTON_RELEASED); event->time_msec, BTN_LEFT, WLR_BUTTON_RELEASED);
} }
} else { } else {
wlr_seat_touch_notify_up(wlr_seat, event->time_msec, event->touch_id); wlr_seat_touch_notify_up(wlr_seat, event->time_msec, event->touch_id);
@ -522,15 +524,15 @@ static void handle_touch_up(struct wl_listener *listener, void *data) {
static void handle_touch_motion(struct wl_listener *listener, void *data) { static void handle_touch_motion(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = struct sway_cursor *cursor =
wl_container_of(listener, cursor, touch_motion); wl_container_of(listener, cursor, touch_motion);
struct wlr_event_touch_motion *event = data; struct wlr_touch_motion_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->touch->base);
struct sway_seat *seat = cursor->seat; struct sway_seat *seat = cursor->seat;
struct wlr_seat *wlr_seat = seat->wlr_seat; struct wlr_seat *wlr_seat = seat->wlr_seat;
struct wlr_surface *surface = NULL; struct wlr_surface *surface = NULL;
double lx, ly; double lx, ly;
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, wlr_cursor_absolute_to_layout_coords(cursor->cursor, &event->touch->base,
event->x, event->y, &lx, &ly); event->x, event->y, &lx, &ly);
double sx, sy; double sx, sy;
node_at_coords(cursor->seat, lx, ly, &surface, &sx, &sy); node_at_coords(cursor->seat, lx, ly, &surface, &sx, &sy);
@ -552,7 +554,8 @@ static void handle_touch_motion(struct wl_listener *listener, void *data) {
double dx, dy; double dx, dy;
dx = lx - cursor->cursor->x; dx = lx - cursor->cursor->x;
dy = ly - cursor->cursor->y; dy = ly - cursor->cursor->y;
pointer_motion(cursor, event->time_msec, event->device, dx, dy, dx, dy); pointer_motion(cursor, event->time_msec, &event->touch->base,
dx, dy, dx, dy);
} }
} else if (surface) { } else if (surface) {
wlr_seat_touch_notify_motion(wlr_seat, event->time_msec, wlr_seat_touch_notify_motion(wlr_seat, event->time_msec,
@ -661,8 +664,8 @@ static void handle_tablet_tool_position(struct sway_cursor *cursor,
static void handle_tool_axis(struct wl_listener *listener, void *data) { static void handle_tool_axis(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_axis); struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_axis);
struct wlr_event_tablet_tool_axis *event = data; struct wlr_tablet_tool_axis_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->tablet->base);
struct sway_tablet_tool *sway_tool = event->tool->data; struct sway_tablet_tool *sway_tool = event->tool->data;
if (!sway_tool) { if (!sway_tool) {
@ -717,8 +720,8 @@ static void handle_tool_axis(struct wl_listener *listener, void *data) {
static void handle_tool_tip(struct wl_listener *listener, void *data) { static void handle_tool_tip(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_tip); struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_tip);
struct wlr_event_tablet_tool_tip *event = data; struct wlr_tablet_tool_tip_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->tablet->base);
struct sway_tablet_tool *sway_tool = event->tool->data; struct sway_tablet_tool *sway_tool = event->tool->data;
struct wlr_tablet_v2_tablet *tablet_v2 = sway_tool->tablet->tablet_v2; struct wlr_tablet_v2_tablet *tablet_v2 = sway_tool->tablet->tablet_v2;
@ -733,7 +736,7 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) {
if (cursor->simulating_pointer_from_tool_tip && if (cursor->simulating_pointer_from_tool_tip &&
event->state == WLR_TABLET_TOOL_TIP_UP) { event->state == WLR_TABLET_TOOL_TIP_UP) {
cursor->simulating_pointer_from_tool_tip = false; cursor->simulating_pointer_from_tool_tip = false;
dispatch_cursor_button(cursor, event->device, event->time_msec, dispatch_cursor_button(cursor, &event->tablet->base, event->time_msec,
BTN_LEFT, WLR_BUTTON_RELEASED); BTN_LEFT, WLR_BUTTON_RELEASED);
wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
} else if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) { } else if (!surface || !wlr_surface_accepts_tablet_v2(tablet_v2, surface)) {
@ -745,8 +748,8 @@ static void handle_tool_tip(struct wl_listener *listener, void *data) {
WLR_TABLET_TOOL_TIP_UP); WLR_TABLET_TOOL_TIP_UP);
} else { } else {
cursor->simulating_pointer_from_tool_tip = true; cursor->simulating_pointer_from_tool_tip = true;
dispatch_cursor_button(cursor, event->device, event->time_msec, dispatch_cursor_button(cursor, &event->tablet->base,
BTN_LEFT, WLR_BUTTON_PRESSED); event->time_msec, BTN_LEFT, WLR_BUTTON_PRESSED);
wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat); wlr_seat_pointer_notify_frame(cursor->seat->wlr_seat);
} }
} else { } else {
@ -768,12 +771,13 @@ static struct sway_tablet *get_tablet_for_device(struct sway_cursor *cursor,
static void handle_tool_proximity(struct wl_listener *listener, void *data) { static void handle_tool_proximity(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = struct sway_cursor *cursor =
wl_container_of(listener, cursor, tool_proximity); wl_container_of(listener, cursor, tool_proximity);
struct wlr_event_tablet_tool_proximity *event = data; struct wlr_tablet_tool_proximity_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->tablet->base);
struct wlr_tablet_tool *tool = event->tool; struct wlr_tablet_tool *tool = event->tool;
if (!tool->data) { if (!tool->data) {
struct sway_tablet *tablet = get_tablet_for_device(cursor, event->device); struct sway_tablet *tablet = get_tablet_for_device(cursor,
&event->tablet->base);
if (!tablet) { if (!tablet) {
sway_log(SWAY_ERROR, "no tablet for tablet tool"); sway_log(SWAY_ERROR, "no tablet for tablet tool");
return; return;
@ -798,8 +802,8 @@ static void handle_tool_proximity(struct wl_listener *listener, void *data) {
static void handle_tool_button(struct wl_listener *listener, void *data) { static void handle_tool_button(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_button); struct sway_cursor *cursor = wl_container_of(listener, cursor, tool_button);
struct wlr_event_tablet_tool_button *event = data; struct wlr_tablet_tool_button_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->tablet->base);
struct sway_tablet_tool *sway_tool = event->tool->data; struct sway_tablet_tool *sway_tool = event->tool->data;
if (!sway_tool) { if (!sway_tool) {
@ -820,14 +824,14 @@ static void handle_tool_button(struct wl_listener *listener, void *data) {
switch (event->state) { switch (event->state) {
case WLR_BUTTON_PRESSED: case WLR_BUTTON_PRESSED:
if (cursor->tool_buttons == 0) { if (cursor->tool_buttons == 0) {
dispatch_cursor_button(cursor, event->device, dispatch_cursor_button(cursor, &event->tablet->base,
event->time_msec, BTN_RIGHT, event->state); event->time_msec, BTN_RIGHT, event->state);
} }
cursor->tool_buttons++; cursor->tool_buttons++;
break; break;
case WLR_BUTTON_RELEASED: case WLR_BUTTON_RELEASED:
if (cursor->tool_buttons == 1) { if (cursor->tool_buttons == 1) {
dispatch_cursor_button(cursor, event->device, dispatch_cursor_button(cursor, &event->tablet->base,
event->time_msec, BTN_RIGHT, event->state); event->time_msec, BTN_RIGHT, event->state);
} }
cursor->tool_buttons--; cursor->tool_buttons--;
@ -927,8 +931,8 @@ static void handle_request_pointer_set_cursor(struct wl_listener *listener,
static void handle_pointer_pinch_begin(struct wl_listener *listener, void *data) { static void handle_pointer_pinch_begin(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, pinch_begin); listener, cursor, pinch_begin);
struct wlr_event_pointer_pinch_begin *event = data; struct wlr_pointer_pinch_begin_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_pinch_begin( wlr_pointer_gestures_v1_send_pinch_begin(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->fingers); event->time_msec, event->fingers);
@ -937,8 +941,8 @@ static void handle_pointer_pinch_begin(struct wl_listener *listener, void *data)
static void handle_pointer_pinch_update(struct wl_listener *listener, void *data) { static void handle_pointer_pinch_update(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, pinch_update); listener, cursor, pinch_update);
struct wlr_event_pointer_pinch_update *event = data; struct wlr_pointer_pinch_update_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_pinch_update( wlr_pointer_gestures_v1_send_pinch_update(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->dx, event->dy, event->time_msec, event->dx, event->dy,
@ -948,8 +952,8 @@ static void handle_pointer_pinch_update(struct wl_listener *listener, void *data
static void handle_pointer_pinch_end(struct wl_listener *listener, void *data) { static void handle_pointer_pinch_end(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, pinch_end); listener, cursor, pinch_end);
struct wlr_event_pointer_pinch_end *event = data; struct wlr_pointer_pinch_end_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_pinch_end( wlr_pointer_gestures_v1_send_pinch_end(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->cancelled); event->time_msec, event->cancelled);
@ -958,8 +962,8 @@ static void handle_pointer_pinch_end(struct wl_listener *listener, void *data) {
static void handle_pointer_swipe_begin(struct wl_listener *listener, void *data) { static void handle_pointer_swipe_begin(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, swipe_begin); listener, cursor, swipe_begin);
struct wlr_event_pointer_swipe_begin *event = data; struct wlr_pointer_swipe_begin_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_swipe_begin( wlr_pointer_gestures_v1_send_swipe_begin(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->fingers); event->time_msec, event->fingers);
@ -968,8 +972,8 @@ static void handle_pointer_swipe_begin(struct wl_listener *listener, void *data)
static void handle_pointer_swipe_update(struct wl_listener *listener, void *data) { static void handle_pointer_swipe_update(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, swipe_update); listener, cursor, swipe_update);
struct wlr_event_pointer_swipe_update *event = data; struct wlr_pointer_swipe_update_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_swipe_update( wlr_pointer_gestures_v1_send_swipe_update(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->dx, event->dy); event->time_msec, event->dx, event->dy);
@ -978,8 +982,8 @@ static void handle_pointer_swipe_update(struct wl_listener *listener, void *data
static void handle_pointer_swipe_end(struct wl_listener *listener, void *data) { static void handle_pointer_swipe_end(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, swipe_end); listener, cursor, swipe_end);
struct wlr_event_pointer_swipe_end *event = data; struct wlr_pointer_swipe_end_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_swipe_end( wlr_pointer_gestures_v1_send_swipe_end(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->cancelled); event->time_msec, event->cancelled);
@ -988,8 +992,8 @@ static void handle_pointer_swipe_end(struct wl_listener *listener, void *data) {
static void handle_pointer_hold_begin(struct wl_listener *listener, void *data) { static void handle_pointer_hold_begin(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, hold_begin); listener, cursor, hold_begin);
struct wlr_event_pointer_hold_begin *event = data; struct wlr_pointer_hold_begin_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_hold_begin( wlr_pointer_gestures_v1_send_hold_begin(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->fingers); event->time_msec, event->fingers);
@ -998,8 +1002,8 @@ static void handle_pointer_hold_begin(struct wl_listener *listener, void *data)
static void handle_pointer_hold_end(struct wl_listener *listener, void *data) { static void handle_pointer_hold_end(struct wl_listener *listener, void *data) {
struct sway_cursor *cursor = wl_container_of( struct sway_cursor *cursor = wl_container_of(
listener, cursor, hold_end); listener, cursor, hold_end);
struct wlr_event_pointer_hold_end *event = data; struct wlr_pointer_hold_end_event *event = data;
cursor_handle_activity_from_device(cursor, event->device); cursor_handle_activity_from_device(cursor, &event->pointer->base);
wlr_pointer_gestures_v1_send_hold_end( wlr_pointer_gestures_v1_send_hold_end(
cursor->pointer_gestures, cursor->seat->wlr_seat, cursor->pointer_gestures, cursor->seat->wlr_seat,
event->time_msec, event->cancelled); event->time_msec, event->cancelled);

@ -401,7 +401,7 @@ static struct wlr_input_method_keyboard_grab_v2 *keyboard_get_im_grab(
} }
static void handle_key_event(struct sway_keyboard *keyboard, static void handle_key_event(struct sway_keyboard *keyboard,
struct wlr_event_keyboard_key *event) { struct wlr_keyboard_key_event *event) {
struct sway_seat *seat = keyboard->seat_device->sway_seat; struct sway_seat *seat = keyboard->seat_device->sway_seat;
struct wlr_seat *wlr_seat = seat->wlr_seat; struct wlr_seat *wlr_seat = seat->wlr_seat;
struct wlr_input_device *wlr_device = struct wlr_input_device *wlr_device =

@ -1574,7 +1574,7 @@ void seatop_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
} }
void seatop_pointer_axis(struct sway_seat *seat, void seatop_pointer_axis(struct sway_seat *seat,
struct wlr_event_pointer_axis *event) { struct wlr_pointer_axis_event *event) {
if (seat->seatop_impl->pointer_axis) { if (seat->seatop_impl->pointer_axis) {
seat->seatop_impl->pointer_axis(seat, event); seat->seatop_impl->pointer_axis(seat, event);
} }

@ -645,7 +645,7 @@ static void handle_tablet_tool_motion(struct sway_seat *seat,
* Functions used by handle_pointer_axis / * Functions used by handle_pointer_axis /
*--------------------------------------*/ *--------------------------------------*/
static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) { static uint32_t wl_axis_to_button(struct wlr_pointer_axis_event *event) {
switch (event->orientation) { switch (event->orientation) {
case WLR_AXIS_ORIENTATION_VERTICAL: case WLR_AXIS_ORIENTATION_VERTICAL:
return event->delta < 0 ? SWAY_SCROLL_UP : SWAY_SCROLL_DOWN; return event->delta < 0 ? SWAY_SCROLL_UP : SWAY_SCROLL_DOWN;
@ -658,9 +658,9 @@ static uint32_t wl_axis_to_button(struct wlr_event_pointer_axis *event) {
} }
static void handle_pointer_axis(struct sway_seat *seat, static void handle_pointer_axis(struct sway_seat *seat,
struct wlr_event_pointer_axis *event) { struct wlr_pointer_axis_event *event) {
struct sway_input_device *input_device = struct sway_input_device *input_device =
event->device ? event->device->data : NULL; event->pointer ? event->pointer->base.data : NULL;
struct input_config *ic = struct input_config *ic =
input_device ? input_device_get_config(input_device) : NULL; input_device ? input_device_get_config(input_device) : NULL;
struct sway_cursor *cursor = seat->cursor; struct sway_cursor *cursor = seat->cursor;

@ -18,9 +18,9 @@ struct seatop_down_event {
}; };
static void handle_pointer_axis(struct sway_seat *seat, static void handle_pointer_axis(struct sway_seat *seat,
struct wlr_event_pointer_axis *event) { struct wlr_pointer_axis_event *event) {
struct sway_input_device *input_device = struct sway_input_device *input_device =
event->device ? event->device->data : NULL; event->pointer ? event->pointer->base.data : NULL;
struct input_config *ic = struct input_config *ic =
input_device ? input_device_get_config(input_device) : NULL; input_device ? input_device_get_config(input_device) : NULL;
float scroll_factor = float scroll_factor =

@ -77,7 +77,7 @@ static void execute_binding(struct sway_switch *sway_switch) {
static void handle_switch_toggle(struct wl_listener *listener, void *data) { static void handle_switch_toggle(struct wl_listener *listener, void *data) {
struct sway_switch *sway_switch = struct sway_switch *sway_switch =
wl_container_of(listener, sway_switch, switch_toggle); wl_container_of(listener, sway_switch, switch_toggle);
struct wlr_event_switch_toggle *event = data; struct wlr_switch_toggle_event *event = data;
struct sway_seat *seat = sway_switch->seat_device->sway_seat; struct sway_seat *seat = sway_switch->seat_device->sway_seat;
seat_idle_notify_activity(seat, IDLE_SOURCE_SWITCH); seat_idle_notify_activity(seat, IDLE_SOURCE_SWITCH);

@ -196,7 +196,7 @@ static void handle_tablet_pad_attach(struct wl_listener *listener,
static void handle_tablet_pad_ring(struct wl_listener *listener, void *data) { static void handle_tablet_pad_ring(struct wl_listener *listener, void *data) {
struct sway_tablet_pad *pad = wl_container_of(listener, pad, ring); struct sway_tablet_pad *pad = wl_container_of(listener, pad, ring);
struct wlr_event_tablet_pad_ring *event = data; struct wlr_tablet_pad_ring_event *event = data;
if (!pad->current_surface) { if (!pad->current_surface) {
return; return;
@ -210,7 +210,7 @@ static void handle_tablet_pad_ring(struct wl_listener *listener, void *data) {
static void handle_tablet_pad_strip(struct wl_listener *listener, void *data) { static void handle_tablet_pad_strip(struct wl_listener *listener, void *data) {
struct sway_tablet_pad *pad = wl_container_of(listener, pad, strip); struct sway_tablet_pad *pad = wl_container_of(listener, pad, strip);
struct wlr_event_tablet_pad_strip *event = data; struct wlr_tablet_pad_strip_event *event = data;
if (!pad->current_surface) { if (!pad->current_surface) {
return; return;
@ -224,7 +224,7 @@ static void handle_tablet_pad_strip(struct wl_listener *listener, void *data) {
static void handle_tablet_pad_button(struct wl_listener *listener, void *data) { static void handle_tablet_pad_button(struct wl_listener *listener, void *data) {
struct sway_tablet_pad *pad = wl_container_of(listener, pad, button); struct sway_tablet_pad *pad = wl_container_of(listener, pad, button);
struct wlr_event_tablet_pad_button *event = data; struct wlr_tablet_pad_button_event *event = data;
if (!pad->current_surface) { if (!pad->current_surface) {
return; return;

Loading…
Cancel
Save