mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
chase: use wayland pointer enums rather than wlr ones
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4575
This commit is contained in:
parent
d8d45dc2cb
commit
5c6e1ed878
6 changed files with 25 additions and 17 deletions
|
|
@ -11,7 +11,7 @@ struct seat;
|
||||||
struct server;
|
struct server;
|
||||||
struct wlr_surface;
|
struct wlr_surface;
|
||||||
struct wlr_scene_node;
|
struct wlr_scene_node;
|
||||||
enum wlr_button_state;
|
enum wl_pointer_button_state;
|
||||||
|
|
||||||
/* Cursors used internally by labwc */
|
/* Cursors used internally by labwc */
|
||||||
enum lab_cursors {
|
enum lab_cursors {
|
||||||
|
|
@ -150,7 +150,7 @@ void cursor_emulate_move_absolute(struct seat *seat,
|
||||||
struct wlr_input_device *device,
|
struct wlr_input_device *device,
|
||||||
double x, double y, uint32_t time_msec);
|
double x, double y, uint32_t time_msec);
|
||||||
void cursor_emulate_button(struct seat *seat,
|
void cursor_emulate_button(struct seat *seat,
|
||||||
uint32_t button, enum wlr_button_state state, uint32_t time_msec);
|
uint32_t button, enum wl_pointer_button_state state, uint32_t time_msec);
|
||||||
void cursor_finish(struct seat *seat);
|
void cursor_finish(struct seat *seat);
|
||||||
|
|
||||||
#endif /* LABWC_CURSOR_H */
|
#endif /* LABWC_CURSOR_H */
|
||||||
|
|
|
||||||
|
|
@ -1153,7 +1153,7 @@ cursor_button(struct wl_listener *listener, void *data)
|
||||||
|
|
||||||
bool notify;
|
bool notify;
|
||||||
switch (event->state) {
|
switch (event->state) {
|
||||||
case WLR_BUTTON_PRESSED:
|
case WL_POINTER_BUTTON_STATE_PRESSED:
|
||||||
notify = cursor_process_button_press(seat, event->button,
|
notify = cursor_process_button_press(seat, event->button,
|
||||||
event->time_msec);
|
event->time_msec);
|
||||||
if (notify) {
|
if (notify) {
|
||||||
|
|
@ -1161,7 +1161,7 @@ cursor_button(struct wl_listener *listener, void *data)
|
||||||
event->button, event->state);
|
event->button, event->state);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WLR_BUTTON_RELEASED:
|
case WL_POINTER_BUTTON_STATE_RELEASED:
|
||||||
notify = cursor_process_button_release(seat, event->button,
|
notify = cursor_process_button_release(seat, event->button,
|
||||||
event->time_msec);
|
event->time_msec);
|
||||||
if (notify) {
|
if (notify) {
|
||||||
|
|
@ -1207,19 +1207,19 @@ cursor_emulate_move_absolute(struct seat *seat, struct wlr_input_device *device,
|
||||||
|
|
||||||
void
|
void
|
||||||
cursor_emulate_button(struct seat *seat, uint32_t button,
|
cursor_emulate_button(struct seat *seat, uint32_t button,
|
||||||
enum wlr_button_state state, uint32_t time_msec)
|
enum wl_pointer_button_state state, uint32_t time_msec)
|
||||||
{
|
{
|
||||||
idle_manager_notify_activity(seat->seat);
|
idle_manager_notify_activity(seat->seat);
|
||||||
|
|
||||||
bool notify;
|
bool notify;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case WLR_BUTTON_PRESSED:
|
case WL_POINTER_BUTTON_STATE_PRESSED:
|
||||||
notify = cursor_process_button_press(seat, button, time_msec);
|
notify = cursor_process_button_press(seat, button, time_msec);
|
||||||
if (notify) {
|
if (notify) {
|
||||||
wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
|
wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case WLR_BUTTON_RELEASED:
|
case WL_POINTER_BUTTON_STATE_RELEASED:
|
||||||
notify = cursor_process_button_release(seat, button, time_msec);
|
notify = cursor_process_button_release(seat, button, time_msec);
|
||||||
if (notify) {
|
if (notify) {
|
||||||
wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
|
wlr_seat_pointer_notify_button(seat->seat, time_msec, button, state);
|
||||||
|
|
@ -1272,14 +1272,14 @@ handle_cursor_axis(struct server *server, struct cursor_context *ctx,
|
||||||
&server->seat.keyboard_group->keyboard);
|
&server->seat.keyboard_group->keyboard);
|
||||||
|
|
||||||
enum direction direction = LAB_DIRECTION_INVALID;
|
enum direction direction = LAB_DIRECTION_INVALID;
|
||||||
if (event->orientation == WLR_AXIS_ORIENTATION_HORIZONTAL) {
|
if (event->orientation == WL_POINTER_AXIS_HORIZONTAL_SCROLL) {
|
||||||
int rel = compare_delta(event, &server->seat.smooth_scroll_offset.x);
|
int rel = compare_delta(event, &server->seat.smooth_scroll_offset.x);
|
||||||
if (rel < 0) {
|
if (rel < 0) {
|
||||||
direction = LAB_DIRECTION_LEFT;
|
direction = LAB_DIRECTION_LEFT;
|
||||||
} else if (rel > 0) {
|
} else if (rel > 0) {
|
||||||
direction = LAB_DIRECTION_RIGHT;
|
direction = LAB_DIRECTION_RIGHT;
|
||||||
}
|
}
|
||||||
} else if (event->orientation == WLR_AXIS_ORIENTATION_VERTICAL) {
|
} else if (event->orientation == WL_POINTER_AXIS_VERTICAL_SCROLL) {
|
||||||
int rel = compare_delta(event, &server->seat.smooth_scroll_offset.y);
|
int rel = compare_delta(event, &server->seat.smooth_scroll_offset.y);
|
||||||
if (rel < 0) {
|
if (rel < 0) {
|
||||||
direction = LAB_DIRECTION_UP;
|
direction = LAB_DIRECTION_UP;
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,11 @@ handle_button(struct wl_listener *listener, void *data)
|
||||||
} else {
|
} else {
|
||||||
uint32_t button = tablet_get_mapped_button(ev->button);
|
uint32_t button = tablet_get_mapped_button(ev->button);
|
||||||
if (button) {
|
if (button) {
|
||||||
cursor_emulate_button(pad->seat, button, ev->state, ev->time_msec);
|
cursor_emulate_button(pad->seat, button,
|
||||||
|
ev->state == WLR_BUTTON_PRESSED
|
||||||
|
? WL_POINTER_BUTTON_STATE_PRESSED
|
||||||
|
: WL_POINTER_BUTTON_STATE_RELEASED,
|
||||||
|
ev->time_msec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -441,8 +441,8 @@ handle_tip(struct wl_listener *listener, void *data)
|
||||||
cursor_emulate_button(tablet->seat,
|
cursor_emulate_button(tablet->seat,
|
||||||
button,
|
button,
|
||||||
ev->state == WLR_TABLET_TOOL_TIP_DOWN
|
ev->state == WLR_TABLET_TOOL_TIP_DOWN
|
||||||
? WLR_BUTTON_PRESSED
|
? WL_POINTER_BUTTON_STATE_PRESSED
|
||||||
: WLR_BUTTON_RELEASED,
|
: WL_POINTER_BUTTON_STATE_RELEASED,
|
||||||
ev->time_msec);
|
ev->time_msec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -500,7 +500,11 @@ handle_button(struct wl_listener *listener, void *data)
|
||||||
} else {
|
} else {
|
||||||
if (button) {
|
if (button) {
|
||||||
is_down_mouse_emulation = ev->state == WLR_BUTTON_PRESSED;
|
is_down_mouse_emulation = ev->state == WLR_BUTTON_PRESSED;
|
||||||
cursor_emulate_button(tablet->seat, button, ev->state, ev->time_msec);
|
cursor_emulate_button(tablet->seat, button,
|
||||||
|
ev->state == WLR_BUTTON_PRESSED
|
||||||
|
? WL_POINTER_BUTTON_STATE_PRESSED
|
||||||
|
: WL_POINTER_BUTTON_STATE_RELEASED,
|
||||||
|
ev->time_msec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ touch_down(struct wl_listener *listener, void *data)
|
||||||
} else {
|
} else {
|
||||||
cursor_emulate_move_absolute(seat, &event->touch->base,
|
cursor_emulate_move_absolute(seat, &event->touch->base,
|
||||||
event->x, event->y, event->time_msec);
|
event->x, event->y, event->time_msec);
|
||||||
cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_PRESSED,
|
cursor_emulate_button(seat, BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED,
|
||||||
event->time_msec);
|
event->time_msec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +146,8 @@ touch_up(struct wl_listener *listener, void *data)
|
||||||
wlr_seat_touch_notify_up(seat->seat, event->time_msec,
|
wlr_seat_touch_notify_up(seat->seat, event->time_msec,
|
||||||
event->touch_id);
|
event->touch_id);
|
||||||
} else {
|
} else {
|
||||||
cursor_emulate_button(seat, BTN_LEFT, WLR_BUTTON_RELEASED,
|
cursor_emulate_button(seat, BTN_LEFT,
|
||||||
event->time_msec);
|
WL_POINTER_BUTTON_STATE_RELEASED, event->time_msec);
|
||||||
}
|
}
|
||||||
wl_list_remove(&touch_point->link);
|
wl_list_remove(&touch_point->link);
|
||||||
zfree(touch_point);
|
zfree(touch_point);
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[wrap-git]
|
[wrap-git]
|
||||||
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
|
url = https://gitlab.freedesktop.org/wlroots/wlroots.git
|
||||||
revision = 811ca199c444525dc4d846d38f76554f1a9b48b0
|
revision = 488a23c16908a83041cf28e134a6f149d831598d
|
||||||
|
|
||||||
[provide]
|
[provide]
|
||||||
dependency_names = wlroots
|
dependency_names = wlroots
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue