[mutter/wip/carlosg/input-thread: 21/96] clutter: Work out stage from actor on which to emit crossing
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 21/96] clutter: Work out stage from actor on which to emit crossing
- Date: Tue, 6 Oct 2020 15:50:42 +0000 (UTC)
commit 2680ef9595011a7f55a3774ced95c2ac4134cffe
Author: Carlos Garnacho <carlosg gnome org>
Date: Fri Jun 5 15:48:57 2020 +0200
clutter: Work out stage from actor on which to emit crossing
Don't rely on the device stage.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
clutter/clutter/clutter-input-device.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-device.c b/clutter/clutter/clutter-input-device.c
index 5f6ad11888..98b4246998 100644
--- a/clutter/clutter/clutter-input-device.c
+++ b/clutter/clutter/clutter-input-device.c
@@ -785,10 +785,22 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
gboolean emit_crossing)
{
ClutterActor *old_actor = clutter_input_device_get_actor (device, sequence);
+ ClutterStage *stage = NULL;
if (old_actor == actor)
return;
+ if (emit_crossing)
+ {
+ if (actor)
+ stage = CLUTTER_STAGE (clutter_actor_get_stage (actor));
+ else if (old_actor)
+ stage = CLUTTER_STAGE (clutter_actor_get_stage (old_actor));
+
+ if (!stage)
+ return;
+ }
+
if (old_actor != NULL)
{
ClutterActor *tmp_old_actor;
@@ -800,7 +812,7 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
event = clutter_event_new (CLUTTER_LEAVE);
event->crossing.time = device->current_time;
event->crossing.flags = 0;
- event->crossing.stage = device->stage;
+ event->crossing.stage = stage;
event->crossing.source = old_actor;
event->crossing.x = device->current_x;
event->crossing.y = device->current_y;
@@ -837,7 +849,7 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
event = clutter_event_new (CLUTTER_ENTER);
event->crossing.time = device->current_time;
event->crossing.flags = 0;
- event->crossing.stage = device->stage;
+ event->crossing.stage = stage;
event->crossing.x = device->current_x;
event->crossing.y = device->current_y;
event->crossing.source = actor;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]