clutter/stage: Switch to clutter_seat_peek_devices()

Switch from clutter_seat_list_devices() to the new peek_devices() method
of ClutterSeat in cases where we're only looping through the returned
list without manipulating it. This way we don't have to unnecessarily
copy around the list of devices.

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1275
This commit is contained in:
Jonas Dreßler 2020-05-29 22:47:00 +02:00 committed by verdre
parent 45c14f74b4
commit 8de91f1053

View File

@ -1409,12 +1409,12 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
ClutterBackend *backend; ClutterBackend *backend;
ClutterSeat *seat; ClutterSeat *seat;
GSList *updating = NULL; GSList *updating = NULL;
GList *l, *devices; const GList *l, *devices;
graphene_point_t point; graphene_point_t point;
backend = clutter_get_default_backend (); backend = clutter_get_default_backend ();
seat = clutter_backend_get_default_seat (backend); seat = clutter_backend_get_default_seat (backend);
devices = clutter_seat_list_devices (seat); devices = clutter_seat_peek_devices (seat);
for (l = devices; l; l = l->next) for (l = devices; l; l = l->next)
{ {
@ -1454,8 +1454,6 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
} }
} }
g_list_free (devices);
return updating; return updating;
} }