mirror of
https://github.com/brl/mutter.git
synced 2025-02-25 17:24:09 +00:00
clutter: Add boolean return value to clutter_stage_get_device_coords()
The device/sequence may not currently have a set of coordinates to return. We correctly leave the out values uninitialized, but don't tell the upper layers in any way. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3183>
This commit is contained in:
parent
1da1b00de4
commit
88af55b857
@ -118,7 +118,7 @@ void clutter_stage_update_device (ClutterStage *stage,
|
||||
gboolean emit_crossing);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
void clutter_stage_get_device_coords (ClutterStage *stage,
|
||||
gboolean clutter_stage_get_device_coords (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
graphene_point_t *coords);
|
||||
|
@ -3134,7 +3134,7 @@ clutter_stage_get_device_actor (ClutterStage *stage,
|
||||
/**
|
||||
* clutter_stage_get_device_coords: (skip):
|
||||
*/
|
||||
void
|
||||
gboolean
|
||||
clutter_stage_get_device_coords (ClutterStage *stage,
|
||||
ClutterInputDevice *device,
|
||||
ClutterEventSequence *sequence,
|
||||
@ -3143,16 +3143,21 @@ clutter_stage_get_device_coords (ClutterStage *stage,
|
||||
ClutterStagePrivate *priv = stage->priv;
|
||||
PointerDeviceEntry *entry = NULL;
|
||||
|
||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||
g_return_if_fail (device != NULL);
|
||||
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
|
||||
g_return_val_if_fail (device != NULL, FALSE);
|
||||
|
||||
if (sequence != NULL)
|
||||
entry = g_hash_table_lookup (priv->touch_sequences, sequence);
|
||||
else
|
||||
entry = g_hash_table_lookup (priv->pointer_devices, device);
|
||||
|
||||
if (entry && coords)
|
||||
if (!entry)
|
||||
return FALSE;
|
||||
|
||||
if (coords)
|
||||
*coords = entry->coords;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user