device: When changing the stage, unset the pointer actor
If we do not unset the Stage we will have stale data, and the Crossing event when re-entering a Stage will not be emitted, as the actor under the pointer might be the same as before.
This commit is contained in:
parent
5d83468295
commit
e0f04efa41
@ -295,9 +295,9 @@ _clutter_input_device_set_stage (ClutterInputDevice *device,
|
|||||||
g_object_weak_unref (G_OBJECT (device->cursor_actor),
|
g_object_weak_unref (G_OBJECT (device->cursor_actor),
|
||||||
cursor_weak_unref,
|
cursor_weak_unref,
|
||||||
device);
|
device);
|
||||||
|
|
||||||
device->cursor_actor = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
device->cursor_actor = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -367,6 +367,14 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
|||||||
cev.crossing.y = device->current_y;
|
cev.crossing.y = device->current_y;
|
||||||
cev.crossing.device = device;
|
cev.crossing.device = device;
|
||||||
|
|
||||||
|
CLUTTER_NOTE (EVENT, "Device '%s' entering '%s' at %d, %d",
|
||||||
|
device->device_name,
|
||||||
|
clutter_actor_get_name (actor) != NULL
|
||||||
|
? clutter_actor_get_name (actor)
|
||||||
|
: G_OBJECT_TYPE_NAME (actor),
|
||||||
|
device->current_x,
|
||||||
|
device->current_y);
|
||||||
|
|
||||||
/* if there is an actor overlapping the Stage boundary and we
|
/* if there is an actor overlapping the Stage boundary and we
|
||||||
* don't do this check then we'll emit an ENTER event only on
|
* don't do this check then we'll emit an ENTER event only on
|
||||||
* the actor instead of emitting it on the Stage *and* the
|
* the actor instead of emitting it on the Stage *and* the
|
||||||
@ -377,6 +385,8 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
|||||||
cev.crossing.source = CLUTTER_ACTOR (device->stage);
|
cev.crossing.source = CLUTTER_ACTOR (device->stage);
|
||||||
cev.crossing.related = NULL;
|
cev.crossing.related = NULL;
|
||||||
|
|
||||||
|
CLUTTER_NOTE (EVENT, "Adding Crossing[Enter] event for Stage");
|
||||||
|
|
||||||
_clutter_process_event (&cev);
|
_clutter_process_event (&cev);
|
||||||
|
|
||||||
cev.crossing.source = actor;
|
cev.crossing.source = actor;
|
||||||
|
Loading…
Reference in New Issue
Block a user