[mutter/wip/garnacho/virtual-input-device: 20/22] clutter/evdev: Allow specifying the ClutterInputMode of virtual devices



commit 33b8a3f73aee34ebfb81936b8b460ad4166d78b4
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Jul 11 18:37:36 2016 +0200

    clutter/evdev: Allow specifying the ClutterInputMode of virtual devices
    
    The seat core keyboard/pointer will be "master", the ones created through
    ClutterVirtualInputDevice will be "slaves".

 clutter/clutter/evdev/clutter-input-device-evdev.c |    5 +++--
 clutter/clutter/evdev/clutter-input-device-evdev.h |    3 ++-
 clutter/clutter/evdev/clutter-seat-evdev.c         |    6 ++++--
 .../evdev/clutter-virtual-input-device-evdev.c     |    3 ++-
 4 files changed, 11 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.c 
b/clutter/clutter/evdev/clutter-input-device-evdev.c
index e4182d1..483a9d1 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.c
@@ -181,7 +181,8 @@ _clutter_input_device_evdev_new (ClutterDeviceManager *manager,
 ClutterInputDevice *
 _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
                                          ClutterSeatEvdev *seat,
-                                         ClutterInputDeviceType type)
+                                         ClutterInputDeviceType type,
+                                         ClutterInputMode mode)
 {
   ClutterInputDeviceEvdev *device;
   ClutterDeviceManagerEvdev *manager_evdev;
@@ -208,7 +209,7 @@ _clutter_input_device_evdev_new_virtual (ClutterDeviceManager *manager,
                          "name", name,
                          "device-manager", manager,
                          "device-type", type,
-                         "device-mode", CLUTTER_INPUT_MODE_MASTER,
+                         "device-mode", mode,
                          "enabled", TRUE,
                          NULL);
 
diff --git a/clutter/clutter/evdev/clutter-input-device-evdev.h 
b/clutter/clutter/evdev/clutter-input-device-evdev.h
index 1c63828..be2c7ef 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.h
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.h
@@ -76,7 +76,8 @@ ClutterInputDevice *      _clutter_input_device_evdev_new             (ClutterDe
 
 ClutterInputDevice *      _clutter_input_device_evdev_new_virtual     (ClutterDeviceManager    *manager,
                                                                        ClutterSeatEvdev        *seat,
-                                                                       ClutterInputDeviceType   type);
+                                                                       ClutterInputDeviceType   type,
+                                                                       ClutterInputMode         mode);
 
 ClutterSeatEvdev *        _clutter_input_device_evdev_get_seat        (ClutterInputDeviceEvdev *device);
 
diff --git a/clutter/clutter/evdev/clutter-seat-evdev.c b/clutter/clutter/evdev/clutter-seat-evdev.c
index 1dc7496..f0b9da7 100644
--- a/clutter/clutter/evdev/clutter-seat-evdev.c
+++ b/clutter/clutter/evdev/clutter-seat-evdev.c
@@ -127,7 +127,8 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
 
   seat->manager_evdev = manager_evdev;
   device = _clutter_input_device_evdev_new_virtual (
-    manager, seat, CLUTTER_POINTER_DEVICE);
+      manager, seat, CLUTTER_POINTER_DEVICE,
+      CLUTTER_INPUT_MODE_MASTER);
   stage = _clutter_device_manager_evdev_get_stage (manager_evdev);
   _clutter_input_device_set_stage (device, stage);
   seat->pointer_x = INITIAL_POINTER_X;
@@ -139,7 +140,8 @@ clutter_seat_evdev_new (ClutterDeviceManagerEvdev *manager_evdev)
   seat->core_pointer = device;
 
   device = _clutter_input_device_evdev_new_virtual (
-    manager, seat, CLUTTER_KEYBOARD_DEVICE);
+      manager, seat, CLUTTER_KEYBOARD_DEVICE,
+      CLUTTER_INPUT_MODE_MASTER);
   _clutter_input_device_set_stage (device, stage);
   _clutter_device_manager_add_device (manager, device);
   seat->core_keyboard = device;
diff --git a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c 
b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
index b4925e1..ceda3c6 100644
--- a/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-virtual-input-device-evdev.c
@@ -305,7 +305,8 @@ clutter_virtual_input_device_evdev_constructed (GObject *object)
   virtual_evdev->device =
     _clutter_input_device_evdev_new_virtual (manager,
                                              virtual_evdev->seat,
-                                             device_type);
+                                             device_type,
+                                             CLUTTER_INPUT_MODE_SLAVE);
 
   stage = _clutter_device_manager_evdev_get_stage (CLUTTER_DEVICE_MANAGER_EVDEV (manager));
   _clutter_input_device_set_stage (virtual_evdev->device, stage);


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