[mutter/wip/carlosg/no-event-source: 6/14] wayland: Move away from clutter_event_get_source()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/no-event-source: 6/14] wayland: Move away from clutter_event_get_source()
- Date: Tue, 1 Mar 2022 22:22:32 +0000 (UTC)
commit 641d80354076cb24a5754ea88242150861930604
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Feb 25 13:05:33 2022 +0100
wayland: Move away from clutter_event_get_source()
Instead ask the stage about the target actor, which is equivalent
and ensured to be up-to-date.
src/wayland/meta-wayland-pointer.c | 10 ++++++++--
src/wayland/meta-wayland-tablet-tool.c | 6 ++++--
src/wayland/meta-wayland-touch.c | 4 +++-
3 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c
index 7e74b9e9e7..3b8b104115 100644
--- a/src/wayland/meta-wayland-pointer.c
+++ b/src/wayland/meta-wayland-pointer.c
@@ -641,9 +641,15 @@ repick_for_event (MetaWaylandPointer *pointer,
MetaWaylandSurface *surface;
if (clutter_event_type (for_event) == CLUTTER_LEAVE)
- actor = clutter_event_get_related (for_event);
+ {
+ actor = clutter_event_get_related (for_event);
+ }
else
- actor = clutter_event_get_source (for_event);
+ {
+ actor = clutter_stage_get_device_actor (clutter_event_get_stage (for_event),
+ clutter_event_get_device (for_event),
+ clutter_event_get_event_sequence (for_event));
+ }
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
{
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c
index 815b09904f..8f4ebe82f9 100644
--- a/src/wayland/meta-wayland-tablet-tool.c
+++ b/src/wayland/meta-wayland-tablet-tool.c
@@ -585,9 +585,11 @@ static void
repick_for_event (MetaWaylandTabletTool *tool,
const ClutterEvent *for_event)
{
- ClutterActor *actor = NULL;
+ ClutterActor *actor;
- actor = clutter_event_get_source (for_event);
+ actor = clutter_stage_get_device_actor (clutter_event_get_stage (for_event),
+ clutter_event_get_device (for_event),
+ clutter_event_get_event_sequence (for_event));
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
tool->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
diff --git a/src/wayland/meta-wayland-touch.c b/src/wayland/meta-wayland-touch.c
index 0280195e8e..5824e229d6 100644
--- a/src/wayland/meta-wayland-touch.c
+++ b/src/wayland/meta-wayland-touch.c
@@ -220,7 +220,9 @@ meta_wayland_touch_update (MetaWaylandTouch *touch,
MetaWaylandSurface *surface = NULL;
ClutterActor *actor;
- actor = clutter_event_get_source (event);
+ actor = clutter_stage_get_device_actor (clutter_event_get_stage (event),
+ clutter_event_get_device (event),
+ clutter_event_get_event_sequence (event));
if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]