diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index f5893d715a..ff7dc0d59f 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -12586,11 +12586,13 @@ list_devices (GtkWidget *widget, GdkDeviceType device_type, GList **result) { - G_GNUC_BEGIN_IGNORE_DEPRECATIONS; - GList *devices = gdk_device_manager_list_devices (device_manager, device_type); - G_GNUC_END_IGNORE_DEPRECATIONS; + GList *devices; GList *l; + G_GNUC_BEGIN_IGNORE_DEPRECATIONS; + devices = gdk_device_manager_list_devices (device_manager, device_type); + G_GNUC_END_IGNORE_DEPRECATIONS; + for (l = devices; l; l = l->next) { GdkDevice *device = l->data;