libinput: Forward frame events to clients
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=77353 Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
e57d1f211d
commit
1679f232e5
@ -1402,6 +1402,11 @@ touch_move_grab_motion(struct weston_touch_grab *grab, uint32_t time,
|
|||||||
weston_compositor_schedule_repaint(es->compositor);
|
weston_compositor_schedule_repaint(es->compositor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
touch_move_grab_frame(struct weston_touch_grab *grab)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_move_grab_cancel(struct weston_touch_grab *grab)
|
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_down,
|
||||||
touch_move_grab_up,
|
touch_move_grab_up,
|
||||||
touch_move_grab_motion,
|
touch_move_grab_motion,
|
||||||
|
touch_move_grab_frame,
|
||||||
touch_move_grab_cancel,
|
touch_move_grab_cancel,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -278,6 +278,7 @@ struct weston_touch_grab_interface {
|
|||||||
int touch_id,
|
int touch_id,
|
||||||
wl_fixed_t sx,
|
wl_fixed_t sx,
|
||||||
wl_fixed_t sy);
|
wl_fixed_t sy);
|
||||||
|
void (*frame)(struct weston_touch_grab *grab);
|
||||||
void (*cancel)(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
|
void
|
||||||
notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
|
notify_touch(struct weston_seat *seat, uint32_t time, int touch_id,
|
||||||
wl_fixed_t x, wl_fixed_t y, int touch_type);
|
wl_fixed_t x, wl_fixed_t y, int touch_type);
|
||||||
|
void
|
||||||
|
notify_touch_frame(struct weston_seat *seat);
|
||||||
|
|
||||||
void
|
void
|
||||||
weston_layer_init(struct weston_layer *layer, struct wl_list *below);
|
weston_layer_init(struct weston_layer *layer, struct wl_list *below);
|
||||||
|
@ -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
|
static void
|
||||||
drag_grab_touch_cancel(struct weston_touch_grab *grab)
|
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_down,
|
||||||
drag_grab_touch_up,
|
drag_grab_touch_up,
|
||||||
drag_grab_touch_motion,
|
drag_grab_touch_motion,
|
||||||
|
drag_grab_touch_frame,
|
||||||
drag_grab_touch_cancel
|
drag_grab_touch_cancel
|
||||||
};
|
};
|
||||||
|
|
||||||
|
19
src/input.c
19
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
|
static void
|
||||||
default_grab_touch_cancel(struct weston_touch_grab *grab)
|
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_down,
|
||||||
default_grab_touch_up,
|
default_grab_touch_up,
|
||||||
default_grab_touch_motion,
|
default_grab_touch_motion,
|
||||||
|
default_grab_touch_frame,
|
||||||
default_grab_touch_cancel,
|
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
|
static void
|
||||||
pointer_cursor_surface_configure(struct weston_surface *es,
|
pointer_cursor_surface_configure(struct weston_surface *es,
|
||||||
int32_t dx, int32_t dy)
|
int32_t dx, int32_t dy)
|
||||||
|
@ -187,6 +187,17 @@ handle_touch_up(struct libinput_device *libinput_device,
|
|||||||
notify_touch(device->seat, time, slot, 0, 0, WL_TOUCH_UP);
|
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
|
int
|
||||||
evdev_device_process_event(struct libinput_event *event)
|
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,
|
handle_touch_up(libinput_device,
|
||||||
libinput_event_get_touch_event(event));
|
libinput_event_get_touch_event(event));
|
||||||
break;
|
break;
|
||||||
|
case LIBINPUT_EVENT_TOUCH_FRAME:
|
||||||
|
handle_touch_frame(libinput_device,
|
||||||
|
libinput_event_get_touch_event(event));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
handled = 0;
|
handled = 0;
|
||||||
weston_log("unknown libinput event %d\n",
|
weston_log("unknown libinput event %d\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user