[mutter/wip/carlosg/cancel-pointer-gestures-on-unfocus: 24/25] wayland: Add pointer gesture cancellation internal API
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/cancel-pointer-gestures-on-unfocus: 24/25] wayland: Add pointer gesture cancellation internal API
- Date: Thu, 29 Sep 2022 12:36:56 +0000 (UTC)
commit 57074463ab86b1383a25c2957c1feb7901b5e18f
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Sep 23 15:55:27 2022 +0200
wayland: Add pointer gesture cancellation internal API
This is ATM unused, but will be used to trigger cancellation of
any active gesture.
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2640>
src/wayland/meta-wayland-pointer-gesture-hold.c | 9 +++++++++
src/wayland/meta-wayland-pointer-gesture-hold.h | 3 +++
src/wayland/meta-wayland-pointer-gesture-pinch.c | 9 +++++++++
src/wayland/meta-wayland-pointer-gesture-pinch.h | 3 +++
src/wayland/meta-wayland-pointer-gesture-swipe.c | 9 +++++++++
src/wayland/meta-wayland-pointer-gesture-swipe.h | 3 +++
6 files changed, 36 insertions(+)
---
diff --git a/src/wayland/meta-wayland-pointer-gesture-hold.c b/src/wayland/meta-wayland-pointer-gesture-hold.c
index 2bda793536..90c63cd257 100644
--- a/src/wayland/meta-wayland-pointer-gesture-hold.c
+++ b/src/wayland/meta-wayland-pointer-gesture-hold.c
@@ -149,3 +149,12 @@ meta_wayland_pointer_gesture_hold_create_new_resource (MetaWaylandPointer *point
wl_list_insert (&pointer_client->hold_gesture_resources,
wl_resource_get_link (res));
}
+
+void
+meta_wayland_pointer_gesture_hold_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial)
+{
+ broadcast_end (pointer, serial,
+ us2ms (g_get_monotonic_time ()),
+ TRUE);
+}
diff --git a/src/wayland/meta-wayland-pointer-gesture-hold.h b/src/wayland/meta-wayland-pointer-gesture-hold.h
index 55846bff6f..f79c0b1099 100644
--- a/src/wayland/meta-wayland-pointer-gesture-hold.h
+++ b/src/wayland/meta-wayland-pointer-gesture-hold.h
@@ -34,4 +34,7 @@ void meta_wayland_pointer_gesture_hold_create_new_resource (MetaWaylandPointer *
struct wl_resource *gestures_resource,
uint32_t id);
+void meta_wayland_pointer_gesture_hold_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial);
+
#endif /* META_WAYLAND_POINTER_GESTURE_HOLD_H */
diff --git a/src/wayland/meta-wayland-pointer-gesture-pinch.c
b/src/wayland/meta-wayland-pointer-gesture-pinch.c
index 01eb97c729..32a6bad69f 100644
--- a/src/wayland/meta-wayland-pointer-gesture-pinch.c
+++ b/src/wayland/meta-wayland-pointer-gesture-pinch.c
@@ -180,3 +180,12 @@ meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer *poin
wl_list_insert (&pointer_client->pinch_gesture_resources,
wl_resource_get_link (res));
}
+
+void
+meta_wayland_pointer_gesture_pinch_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial)
+{
+ broadcast_end (pointer, serial,
+ us2ms (g_get_monotonic_time ()),
+ TRUE);
+}
diff --git a/src/wayland/meta-wayland-pointer-gesture-pinch.h
b/src/wayland/meta-wayland-pointer-gesture-pinch.h
index 9ea3733f79..f5f1461aba 100644
--- a/src/wayland/meta-wayland-pointer-gesture-pinch.h
+++ b/src/wayland/meta-wayland-pointer-gesture-pinch.h
@@ -36,4 +36,7 @@ void meta_wayland_pointer_gesture_pinch_create_new_resource (MetaWaylandPointer
struct wl_resource *gestures_resource,
uint32_t id);
+void meta_wayland_pointer_gesture_pinch_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial);
+
#endif /* META_WAYLAND_POINTER_GESTURE_PINCH_H */
diff --git a/src/wayland/meta-wayland-pointer-gesture-swipe.c
b/src/wayland/meta-wayland-pointer-gesture-swipe.c
index e3f65bfc30..dc7abb3c8d 100644
--- a/src/wayland/meta-wayland-pointer-gesture-swipe.c
+++ b/src/wayland/meta-wayland-pointer-gesture-swipe.c
@@ -176,3 +176,12 @@ meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer *poin
wl_list_insert (&pointer_client->swipe_gesture_resources,
wl_resource_get_link (res));
}
+
+void
+meta_wayland_pointer_gesture_swipe_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial)
+{
+ broadcast_end (pointer, serial,
+ us2ms (g_get_monotonic_time ()),
+ TRUE);
+}
diff --git a/src/wayland/meta-wayland-pointer-gesture-swipe.h
b/src/wayland/meta-wayland-pointer-gesture-swipe.h
index ed53fc4b2d..7d7c679d6c 100644
--- a/src/wayland/meta-wayland-pointer-gesture-swipe.h
+++ b/src/wayland/meta-wayland-pointer-gesture-swipe.h
@@ -36,4 +36,7 @@ void meta_wayland_pointer_gesture_swipe_create_new_resource (MetaWaylandPointer
struct wl_resource *pointer_resource,
uint32_t id);
+void meta_wayland_pointer_gesture_swipe_cancel (MetaWaylandPointer *pointer,
+ uint32_t serial);
+
#endif /* META_WAYLAND_POINTER_GESTURE_SWIPE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]