[mutter/wip/carlosg/input-thread: 139/159] clutter: Don't keep extra copy on device events
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 139/159] clutter: Don't keep extra copy on device events
- Date: Wed, 12 Aug 2020 17:24:05 +0000 (UTC)
commit ea958c9bed3f070fe4be4caa4e095c030bcb625e
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 11 13:09:39 2020 +0200
clutter: Don't keep extra copy on device events
clutter/clutter/clutter-event.c | 6 +-----
src/backends/native/meta-seat-impl.c | 2 +-
src/backends/native/meta-seat-native.c | 8 --------
3 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c
index 378ffb45d4..c230c56b06 100644
--- a/clutter/clutter/clutter-event.c
+++ b/clutter/clutter/clutter-event.c
@@ -1168,7 +1168,7 @@ clutter_event_set_device (ClutterEvent *event,
case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED:
- g_set_object (&event->device.device, device);
+ event->device.device = device;
break;
}
}
@@ -1427,9 +1427,6 @@ clutter_event_copy (const ClutterEvent *event)
case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED:
- g_set_object (&new_event->device.device, event->device.device);
- break;
-
default:
break;
}
@@ -1486,7 +1483,6 @@ clutter_event_free (ClutterEvent *event)
break;
case CLUTTER_DEVICE_ADDED:
case CLUTTER_DEVICE_REMOVED:
- g_clear_object (&event->device.device);
break;
default:
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 85db01d72f..94c41cf935 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -1448,7 +1448,7 @@ evdev_add_device (MetaSeatImpl *seat,
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
* ClutterInputDevice API */
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index d06de2b17b..3fd268091b 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -170,14 +170,6 @@ meta_seat_native_finalize (GObject *object)
g_clear_object (&seat->core_keyboard);
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_object_unref (seat->cursor_renderer);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]