diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c index 073278900..bc4a25850 100644 --- a/desktop-shell/shell.c +++ b/desktop-shell/shell.c @@ -1402,6 +1402,11 @@ touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time, weston_compositor_schedule_repaint(es->compositor); } +static void +touch_move_grab_frame(struct weston_touch_grab *grab) +{ +} + static void touch_move_grab_cancel(struct weston_touch_grab *grab) { @@ -1417,6 +1422,7 @@ static const struct weston_touch_grab_interface touch_move_grab_interface = { touch_move_grab_down, touch_move_grab_up, touch_move_grab_motion, + touch_move_grab_frame, touch_move_grab_cancel, }; diff --git a/src/compositor.h b/src/compositor.h index af41b008c..03d899224 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -278,6 +278,7 @@ struct weston_touch_grab_interface { int touch_id, wl_fixed_t sx, wl_fixed_t sy); + void (*frame)(struct weston_touch_grab *grab); void (*cancel)(struct weston_touch_grab *grab); }; @@ -1008,6 +1009,8 @@ notify_keyboard_focus_out(struct weston_seat *seat); void notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, wl_fixed_t x, wl_fixed_t y, int touch_type); +void +notify_touch_frame(struct weston_seat *seat); void weston_layer_init(struct weston_layer *layer, struct wl_list *below); diff --git a/src/data-device.c b/src/data-device.c index 483e22e9d..6a81bc8e7 100644 --- a/src/data-device.c +++ b/src/data-device.c @@ -496,6 +496,11 @@ drag_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time, } } +static void +drag_grab_touch_frame(struct weston_touch_grab *grab) +{ +} + static void drag_grab_touch_cancel(struct weston_touch_grab *grab) { @@ -511,6 +516,7 @@ static const struct weston_touch_grab_interface touch_drag_grab_interface = { drag_grab_touch_down, drag_grab_touch_up, drag_grab_touch_motion, + drag_grab_touch_frame, drag_grab_touch_cancel }; diff --git a/src/input.c b/src/input.c index 9c5146894..2c799f434 100644 --- a/src/input.c +++ b/src/input.c @@ -286,6 +286,15 @@ default_grab_touch_motion(struct weston_touch_grab *grab, uint32_t time, } } +static void +default_grab_touch_frame(struct weston_touch_grab *grab) +{ + struct wl_resource *resource; + + wl_resource_for_each(resource, &grab->touch->focus_resource_list) + wl_touch_send_frame(resource); +} + static void default_grab_touch_cancel(struct weston_touch_grab *grab) { @@ -295,6 +304,7 @@ static const struct weston_touch_grab_interface default_touch_grab_interface = { default_grab_touch_down, default_grab_touch_up, default_grab_touch_motion, + default_grab_touch_frame, default_grab_touch_cancel, }; @@ -1512,6 +1522,15 @@ notify_touch(struct weston_seat *seat, uint32_t time, int touch_id, } } +WL_EXPORT void +notify_touch_frame(struct weston_seat *seat) +{ + struct weston_touch *touch = seat->touch; + struct weston_touch_grab *grab = touch->grab; + + grab->interface->frame(grab); +} + static void pointer_cursor_surface_configure(struct weston_surface *es, int32_t dx, int32_t dy) diff --git a/src/libinput-device.c b/src/libinput-device.c index 6a321a4c7..0ca6c4ba1 100644 --- a/src/libinput-device.c +++ b/src/libinput-device.c @@ -187,6 +187,17 @@ handle_touch_up(struct libinput_device *libinput_device, notify_touch(device->seat, time, slot, 0, 0, WL_TOUCH_UP); } +static void +handle_touch_frame(struct libinput_device *libinput_device, + struct libinput_event_touch *touch_event) +{ + struct evdev_device *device = + libinput_device_get_user_data(libinput_device); + struct weston_seat *seat = device->seat; + + notify_touch_frame(seat); +} + int evdev_device_process_event(struct libinput_event *event) { @@ -228,6 +239,10 @@ evdev_device_process_event(struct libinput_event *event) handle_touch_up(libinput_device, libinput_event_get_touch_event(event)); break; + case LIBINPUT_EVENT_TOUCH_FRAME: + handle_touch_frame(libinput_device, + libinput_event_get_touch_event(event)); + break; default: handled = 0; weston_log("unknown libinput event %d\n",