From 9ea7f887539030d14f93987c88bd59d733ccca77 Mon Sep 17 00:00:00 2001 From: akallabeth Date: Tue, 2 Mar 2021 08:49:50 +0100 Subject: [PATCH] Added pointer frame events --- uwac/include/uwac/uwac.h | 12 +++++++++++- uwac/libuwac/uwac-input.c | 14 +++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/uwac/include/uwac/uwac.h b/uwac/include/uwac/uwac.h index 819796105..bbe4542a9 100644 --- a/uwac/include/uwac/uwac.h +++ b/uwac/include/uwac/uwac.h @@ -107,7 +107,8 @@ enum UWAC_EVENT_CLIPBOARD_SELECT, UWAC_EVENT_CLIPBOARD_OFFER, UWAC_EVENT_OUTPUT_GEOMETRY, - UWAC_EVENT_POINTER_AXIS_DISCRETE + UWAC_EVENT_POINTER_AXIS_DISCRETE, + UWAC_EVENT_POINTER_FRAME }; /** @brief window states */ @@ -195,6 +196,14 @@ struct uwac_pointer_axis_event }; typedef struct uwac_pointer_axis_event UwacPointerAxisEvent; +struct uwac_pointer_frame_event +{ + int type; + UwacWindow* window; + UwacSeat* seat; +}; +typedef struct uwac_pointer_frame_event UwacPointerFrameEvent; + struct uwac_touch_frame_event { int type; @@ -286,6 +295,7 @@ union uwac_event { UwacPointerMotionEvent mouse_motion; UwacPointerButtonEvent mouse_button; UwacPointerAxisEvent mouse_axis; + UwacPointerFrameEvent mouse_frame; UwacKeyboardEnterLeaveEvent keyboard_enter_leave; UwacKeyboardModifiersEvent keyboard_modifiers; UwacClipboardEvent clipboard; diff --git a/uwac/libuwac/uwac-input.c b/uwac/libuwac/uwac-input.c index 1e0200167..261b226e7 100644 --- a/uwac/libuwac/uwac-input.c +++ b/uwac/libuwac/uwac-input.c @@ -844,7 +844,19 @@ static void pointer_handle_axis(void* data, struct wl_pointer* pointer, uint32_t static void pointer_frame(void* data, struct wl_pointer* wl_pointer) { - /*UwacSeat *seat = data;*/ + UwacPointerFrameEvent* event; + UwacSeat* seat = data; + UwacWindow* window = seat->pointer_focus; + + if (!window) + return; + + event = (UwacPointerFrameEvent*)UwacDisplayNewEvent(seat->display, UWAC_EVENT_POINTER_FRAME); + if (!event) + return; + + event->seat = seat; + event->window = window; } static void pointer_axis_source(void* data, struct wl_pointer* wl_pointer, uint32_t axis_source)