[clutter/clutter-1.18] evdev: Extract code for setting the libinput seat out



commit defe55ff097aa53897bdd43c5ffdeadaab9f2a85
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Mar 10 10:20:52 2014 -0400

    evdev: Extract code for setting the libinput seat out
    
    We're going to create the main seat at an earlier time, when
    we don't have the physical libinput_seat yet, so we need to
    do the association later.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726199

 clutter/evdev/clutter-device-manager-evdev.c |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/clutter/evdev/clutter-device-manager-evdev.c b/clutter/evdev/clutter-device-manager-evdev.c
index 81ae92c..ad342d5 100644
--- a/clutter/evdev/clutter-device-manager-evdev.c
+++ b/clutter/evdev/clutter-device-manager-evdev.c
@@ -636,6 +636,17 @@ clutter_event_source_free (ClutterEventSource *source)
   g_source_unref (g_source);
 }
 
+static void
+clutter_seat_evdev_set_libinput_seat (ClutterSeatEvdev *seat,
+                                      struct libinput_seat *libinput_seat)
+{
+  g_assert (seat->libinput_seat == NULL);
+
+  libinput_seat_ref (libinput_seat);
+  libinput_seat_set_user_data (libinput_seat, seat);
+  seat->libinput_seat = libinput_seat;
+}
+
 static ClutterSeatEvdev *
 clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev,
                         struct libinput_seat *libinput_seat)
@@ -652,9 +663,7 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev,
   if (!seat)
     return NULL;
 
-  libinput_seat_ref (libinput_seat);
-  libinput_seat_set_user_data (libinput_seat, seat);
-  seat->libinput_seat = libinput_seat;
+  clutter_seat_evdev_set_libinput_seat (seat, libinput_seat);
 
   device = _clutter_input_device_evdev_new_virtual (
     manager, seat, CLUTTER_POINTER_DEVICE);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]