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
This commit is contained in:
Carlos Garnacho 2016-07-11 18:37:36 +02:00
parent 0992b5c53e
commit 27a77fa115
4 changed files with 11 additions and 6 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -302,7 +302,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);