mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 23:50:41 -05:00
clutter: Pass base event to clutter_input_device_update()
So we may fetch coordinates without necessarily querying the device state. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403>
This commit is contained in:
parent
932a5cab09
commit
730da1dbe1
@ -180,7 +180,7 @@ ClutterActor * clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterStage *stage,
|
||||
gboolean emit_crossing,
|
||||
uint32_t time_ms);
|
||||
ClutterEvent *for_event);
|
||||
CLUTTER_EXPORT
|
||||
void _clutter_input_device_add_event_sequence (ClutterInputDevice *device,
|
||||
ClutterEvent *event);
|
||||
|
@ -689,6 +689,7 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
ClutterStage *stage,
|
||||
ClutterActor *actor,
|
||||
gboolean emit_crossing,
|
||||
graphene_point_t coords,
|
||||
uint32_t time_ms)
|
||||
{
|
||||
ClutterActor *old_actor = clutter_input_device_get_actor (device, sequence);
|
||||
@ -709,8 +710,8 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.flags = 0;
|
||||
event->crossing.stage = stage;
|
||||
event->crossing.source = old_actor;
|
||||
event->crossing.x = device->current_x;
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.x = coords.x;
|
||||
event->crossing.y = coords.y;
|
||||
event->crossing.related = actor;
|
||||
event->crossing.sequence = sequence;
|
||||
clutter_event_set_device (event, device);
|
||||
@ -745,8 +746,8 @@ _clutter_input_device_set_actor (ClutterInputDevice *device,
|
||||
event->crossing.time = time_ms;
|
||||
event->crossing.flags = 0;
|
||||
event->crossing.stage = stage;
|
||||
event->crossing.x = device->current_x;
|
||||
event->crossing.y = device->current_y;
|
||||
event->crossing.x = coords.x;
|
||||
event->crossing.y = coords.y;
|
||||
event->crossing.source = actor;
|
||||
event->crossing.related = old_actor;
|
||||
event->crossing.sequence = sequence;
|
||||
@ -879,17 +880,27 @@ clutter_input_device_update (ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
ClutterStage *stage,
|
||||
gboolean emit_crossing,
|
||||
uint32_t time_ms)
|
||||
ClutterEvent *for_event)
|
||||
{
|
||||
ClutterActor *new_cursor_actor;
|
||||
ClutterActor *old_cursor_actor;
|
||||
graphene_point_t point = GRAPHENE_POINT_INIT (-1.0f, -1.0f);
|
||||
ClutterInputDeviceType device_type = device->device_type;
|
||||
uint32_t time_ms;
|
||||
|
||||
g_assert (device_type != CLUTTER_KEYBOARD_DEVICE &&
|
||||
device_type != CLUTTER_PAD_DEVICE);
|
||||
|
||||
clutter_input_device_get_coords (device, sequence, &point);
|
||||
if (for_event)
|
||||
{
|
||||
clutter_event_get_coords (for_event, &point.x, &point.y);
|
||||
time_ms = clutter_event_get_time (for_event);
|
||||
}
|
||||
else
|
||||
{
|
||||
clutter_input_device_get_coords (device, sequence, &point);
|
||||
time_ms = CLUTTER_CURRENT_TIME;
|
||||
}
|
||||
|
||||
old_cursor_actor = clutter_input_device_get_actor (device, sequence);
|
||||
new_cursor_actor =
|
||||
@ -918,7 +929,7 @@ clutter_input_device_update (ClutterInputDevice *device,
|
||||
stage,
|
||||
new_cursor_actor,
|
||||
emit_crossing,
|
||||
time_ms);
|
||||
point, time_ms);
|
||||
|
||||
return new_cursor_actor;
|
||||
}
|
||||
@ -1512,12 +1523,15 @@ _clutter_input_device_remove_event_sequence (ClutterInputDevice *device,
|
||||
g_hash_table_lookup (device->inv_touch_sequence_actors, info->actor);
|
||||
ClutterStage *stage =
|
||||
CLUTTER_STAGE (clutter_actor_get_stage (info->actor));
|
||||
graphene_point_t point;
|
||||
|
||||
sequences = g_list_remove (sequences, sequence);
|
||||
|
||||
g_hash_table_replace (device->inv_touch_sequence_actors,
|
||||
info->actor, sequences);
|
||||
_clutter_input_device_set_actor (device, sequence, stage, NULL, TRUE,
|
||||
clutter_event_get_coords (event, &point.x, &point.y);
|
||||
_clutter_input_device_set_actor (device, sequence, stage,
|
||||
NULL, TRUE, point,
|
||||
clutter_event_get_time (event));
|
||||
}
|
||||
|
||||
|
@ -1626,7 +1626,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
|
||||
actor = clutter_input_device_update (device, NULL,
|
||||
CLUTTER_STAGE (stage), FALSE,
|
||||
clutter_event_get_time (event));
|
||||
event);
|
||||
if (actor != stage)
|
||||
{
|
||||
ClutterEvent *crossing;
|
||||
@ -1777,8 +1777,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
|
||||
actor = clutter_input_device_update (device, NULL,
|
||||
CLUTTER_STAGE (stage),
|
||||
TRUE,
|
||||
clutter_event_get_time (event));
|
||||
TRUE, event);
|
||||
if (actor == NULL)
|
||||
break;
|
||||
|
||||
@ -1888,8 +1887,7 @@ _clutter_process_event_details (ClutterActor *stage,
|
||||
|
||||
actor = clutter_input_device_update (device, sequence,
|
||||
CLUTTER_STAGE (stage),
|
||||
TRUE,
|
||||
clutter_event_get_time (event));
|
||||
TRUE, event);
|
||||
if (actor == NULL)
|
||||
break;
|
||||
|
||||
|
@ -996,8 +996,7 @@ clutter_stage_update_devices (ClutterStage *stage,
|
||||
for (l = devices; l; l = l->next)
|
||||
{
|
||||
ClutterInputDevice *device = l->data;
|
||||
clutter_input_device_update (device, NULL, stage, TRUE,
|
||||
CLUTTER_CURRENT_TIME);
|
||||
clutter_input_device_update (device, NULL, stage, TRUE, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user