clutter: Don't keep extra copy on device events

https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
This commit is contained in:
Carlos Garnacho 2020-08-11 13:09:39 +02:00
parent 06adde5c6b
commit 6c265c131f
3 changed files with 2 additions and 14 deletions

View File

@ -1165,7 +1165,7 @@ clutter_event_set_device (ClutterEvent *event,
case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED: case CLUTTER_DEVICE_REMOVED:
g_set_object (&event->device.device, device); event->device.device = device;
break; break;
} }
} }
@ -1423,9 +1423,6 @@ clutter_event_copy (const ClutterEvent *event)
case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED: case CLUTTER_DEVICE_REMOVED:
g_set_object (&new_event->device.device, event->device.device);
break;
default: default:
break; break;
} }
@ -1482,7 +1479,6 @@ clutter_event_free (ClutterEvent *event)
break; break;
case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED: case CLUTTER_DEVICE_REMOVED:
g_clear_object (&event->device.device);
break; break;
default: default:

View File

@ -1448,7 +1448,7 @@ evdev_add_device (MetaSeatImpl *seat,
device = meta_input_device_native_new (seat, libinput_device); device = meta_input_device_native_new (seat, libinput_device);
seat->devices = g_slist_prepend (seat->devices, device); seat->devices = g_slist_prepend (seat->devices, g_object_ref (device));
/* Clutter assumes that device types are exclusive in the /* Clutter assumes that device types are exclusive in the
* ClutterInputDevice API */ * ClutterInputDevice API */

View File

@ -170,14 +170,6 @@ meta_seat_native_finalize (GObject *object)
g_clear_object (&seat->core_keyboard); g_clear_object (&seat->core_keyboard);
g_clear_object (&seat->impl); g_clear_object (&seat->impl);
for (iter = seat->devices; iter; iter = g_slist_next (iter))
{
ClutterInputDevice *device = iter->data;
g_object_unref (device);
}
g_slist_free (seat->devices);
g_clear_pointer (&seat->tablet_cursors, g_hash_table_unref); g_clear_pointer (&seat->tablet_cursors, g_hash_table_unref);
g_object_unref (seat->cursor_renderer); g_object_unref (seat->cursor_renderer);