[mutter/wip/garnacho/virtual-input-device: 103/107] clutter/evdev: Allow specifying the ClutterInputMode of virtual devices
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/garnacho/virtual-input-device: 103/107] clutter/evdev: Allow specifying the ClutterInputMode of virtual devices
- Date: Tue, 26 Jul 2016 17:22:49 +0000 (UTC)
commit 70f69e5de4f337896afbed81a8e97cc51598d73a
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".
https://bugzilla.gnome.org/show_bug.cgi?id=765009
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 1d8acdc..c6f515f 100644
--- a/clutter/clutter/evdev/clutter-input-device-evdev.c
+++ b/clutter/clutter/evdev/clutter-input-device-evdev.c
@@ -196,7 +196,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;
@@ -223,7 +224,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 6835980..5ef3ae4 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]