mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-06 13:29:45 -05:00
wlr-seat: touch grab begin and end
This commit is contained in:
parent
469729d3af
commit
cbb6fd7352
2 changed files with 39 additions and 0 deletions
|
|
@ -407,6 +407,9 @@ struct wlr_seat *wlr_seat_create(struct wl_display *display, const char *name) {
|
|||
wl_signal_init(&wlr_seat->events.keyboard_grab_begin);
|
||||
wl_signal_init(&wlr_seat->events.keyboard_grab_end);
|
||||
|
||||
wl_signal_init(&wlr_seat->events.touch_grab_begin);
|
||||
wl_signal_init(&wlr_seat->events.touch_grab_end);
|
||||
|
||||
return wlr_seat;
|
||||
}
|
||||
|
||||
|
|
@ -867,6 +870,26 @@ void wlr_seat_keyboard_notify_key(struct wlr_seat *seat, uint32_t time,
|
|||
grab->interface->key(grab, time, key, state);
|
||||
}
|
||||
|
||||
void wlr_seat_touch_start_grab(struct wlr_seat *wlr_seat,
|
||||
struct wlr_seat_touch_grab *grab) {
|
||||
grab->seat = wlr_seat;
|
||||
wlr_seat->touch_state.grab = grab;
|
||||
|
||||
wl_signal_emit(&wlr_seat->events.touch_grab_begin, grab);
|
||||
}
|
||||
|
||||
void wlr_seat_touch_end_grab(struct wlr_seat *wlr_seat) {
|
||||
struct wlr_seat_touch_grab *grab = wlr_seat->touch_state.grab;
|
||||
|
||||
if (grab != wlr_seat->touch_state.default_grab) {
|
||||
wlr_seat->touch_state.grab = wlr_seat->touch_state.default_grab;
|
||||
wl_signal_emit(&wlr_seat->events.touch_grab_end, grab);
|
||||
if (grab->interface->cancel) {
|
||||
grab->interface->cancel(grab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void touch_point_destroy(struct wlr_touch_point *point) {
|
||||
wl_list_remove(&point->surface_destroy.link);
|
||||
wl_list_remove(&point->resource_destroy.link);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue