mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
clutter: Move virtual device management to ClutterSeat
A11y in general may be considered a per-seat feature. https://gitlab.gnome.org/GNOME/mutter/merge_requests/852
This commit is contained in:
parent
75ad578a7d
commit
efe698f6e1
@ -45,9 +45,7 @@
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-stage-private.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
#include "clutter-input-device-tool.h"
|
||||
#include "clutter-input-pointer-a11y-private.h"
|
||||
|
||||
struct _ClutterDeviceManagerPrivate
|
||||
{
|
||||
@ -440,43 +438,6 @@ _clutter_device_manager_get_backend (ClutterDeviceManager *manager)
|
||||
return priv->backend;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_create_virtual_device:
|
||||
* @device_manager: a #ClutterDeviceManager
|
||||
* @device_type: the type of the virtual device
|
||||
*
|
||||
* Creates a virtual input device.
|
||||
*
|
||||
* Returns: (transfer full): a newly created virtual device
|
||||
**/
|
||||
ClutterVirtualInputDevice *
|
||||
clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager), NULL);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->create_virtual_device (device_manager,
|
||||
device_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_device_manager_supported_virtua_device_types: (skip)
|
||||
*/
|
||||
ClutterVirtualDeviceType
|
||||
clutter_device_manager_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
ClutterDeviceManagerClass *manager_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_DEVICE_MANAGER (device_manager),
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE);
|
||||
|
||||
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
|
||||
return manager_class->get_supported_virtual_device_types (device_manager);
|
||||
}
|
||||
|
||||
void
|
||||
_clutter_device_manager_compress_motion (ClutterDeviceManager *device_manager,
|
||||
ClutterEvent *event,
|
||||
|
@ -40,17 +40,6 @@ G_DECLARE_DERIVABLE_TYPE (ClutterDeviceManager, clutter_device_manager,
|
||||
|
||||
typedef struct _ClutterDeviceManagerPrivate ClutterDeviceManagerPrivate;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
*/
|
||||
typedef enum _ClutterVirtualDeviceType
|
||||
{
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE = 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD = 1 << 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER = 1 << 1,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_TOUCHSCREEN = 1 << 2,
|
||||
} ClutterVirtualDeviceType;
|
||||
|
||||
/**
|
||||
* ClutterDeviceManagerClass:
|
||||
*
|
||||
@ -75,9 +64,6 @@ struct _ClutterDeviceManagerClass
|
||||
ClutterInputDevice *device);
|
||||
void (* select_stage_events) (ClutterDeviceManager *manager,
|
||||
ClutterStage *stage);
|
||||
ClutterVirtualInputDevice *(* create_virtual_device) (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
ClutterVirtualDeviceType (* get_supported_virtual_device_types) (ClutterDeviceManager *device_manager);
|
||||
void (* compress_motion) (ClutterDeviceManager *device_manger,
|
||||
ClutterEvent *event,
|
||||
const ClutterEvent *to_discard);
|
||||
@ -100,13 +86,6 @@ CLUTTER_EXPORT
|
||||
ClutterInputDevice * clutter_device_manager_get_core_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualInputDevice *clutter_device_manager_create_virtual_device (ClutterDeviceManager *device_manager,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualDeviceType clutter_device_manager_get_supported_virtual_device_types (ClutterDeviceManager *device_manager);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __CLUTTER_DEVICE_MANAGER_H__ */
|
||||
|
@ -586,8 +586,8 @@ _clutter_input_pointer_a11y_add_device (ClutterInputDevice *device)
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (device->device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
clutter_seat_create_virtual_device (device->seat,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
|
||||
device->ptr_a11y_data = g_new0 (ClutterPtrA11yData, 1);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "clutter-marshal.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-seat.h"
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -503,3 +504,39 @@ clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat
|
||||
|
||||
priv->pointer_a11y_settings.dwell_click_type = click_type;
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_create_virtual_device:
|
||||
* @seat: a #ClutterSeat
|
||||
* @device_type: the type of the virtual device
|
||||
*
|
||||
* Creates a virtual input device.
|
||||
*
|
||||
* Returns: (transfer full): a newly created virtual device
|
||||
**/
|
||||
ClutterVirtualInputDevice *
|
||||
clutter_seat_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat), NULL);
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
return seat_class->create_virtual_device (seat, device_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_seat_supported_virtual_device_types: (skip)
|
||||
*/
|
||||
ClutterVirtualDeviceType
|
||||
clutter_seat_get_supported_virtual_device_types (ClutterSeat *seat)
|
||||
{
|
||||
ClutterSeatClass *seat_class;
|
||||
|
||||
g_return_val_if_fail (CLUTTER_IS_SEAT (seat),
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE);
|
||||
|
||||
seat_class = CLUTTER_SEAT_GET_CLASS (seat);
|
||||
return seat_class->get_supported_virtual_device_types (seat);
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "clutter/clutter-types.h"
|
||||
#include "clutter/clutter-keymap.h"
|
||||
#include "clutter/clutter-virtual-input-device.h"
|
||||
|
||||
#define CLUTTER_TYPE_SEAT (clutter_seat_get_type ())
|
||||
|
||||
@ -75,6 +76,17 @@ typedef struct _ClutterPointerA11ySettings
|
||||
gint dwell_threshold;
|
||||
} ClutterPointerA11ySettings;
|
||||
|
||||
/**
|
||||
* ClutterVirtualDeviceType:
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_NONE = 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD = 1 << 0,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER = 1 << 1,
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_TOUCHSCREEN = 1 << 2,
|
||||
} ClutterVirtualDeviceType;
|
||||
|
||||
typedef struct _ClutterSeatClass ClutterSeatClass;
|
||||
|
||||
struct _ClutterSeatClass
|
||||
@ -100,6 +112,11 @@ struct _ClutterSeatClass
|
||||
/* Keyboard accessibility */
|
||||
void (* apply_kbd_a11y_settings) (ClutterSeat *seat,
|
||||
ClutterKbdA11ySettings *settings);
|
||||
|
||||
/* Virtual devices */
|
||||
ClutterVirtualInputDevice * (* create_virtual_device) (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type);
|
||||
ClutterVirtualDeviceType (* get_supported_virtual_device_types) (ClutterSeat *seat);
|
||||
};
|
||||
|
||||
CLUTTER_EXPORT
|
||||
@ -134,5 +151,11 @@ void clutter_seat_get_pointer_a11y_settings (ClutterSeat *seat,
|
||||
CLUTTER_EXPORT
|
||||
void clutter_seat_set_pointer_a11y_dwell_click_type (ClutterSeat *seat,
|
||||
ClutterPointerA11yDwellClickType click_type);
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualInputDevice *clutter_seat_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterVirtualDeviceType clutter_seat_get_supported_virtual_device_types (ClutterSeat *seat);
|
||||
|
||||
#endif /* CLUTTER_SEAT_H */
|
||||
|
@ -27,15 +27,15 @@
|
||||
|
||||
#include "clutter-virtual-input-device.h"
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-enum-types.h"
|
||||
#include "clutter-private.h"
|
||||
#include "clutter-seat.h"
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_DEVICE_MANAGER,
|
||||
PROP_SEAT,
|
||||
PROP_DEVICE_TYPE,
|
||||
|
||||
PROP_LAST
|
||||
@ -45,7 +45,7 @@ static GParamSpec *obj_props[PROP_LAST];
|
||||
|
||||
typedef struct _ClutterVirtualInputDevicePrivate
|
||||
{
|
||||
ClutterDeviceManager *manager;
|
||||
ClutterSeat *seat;
|
||||
ClutterInputDeviceType device_type;
|
||||
} ClutterVirtualInputDevicePrivate;
|
||||
|
||||
@ -181,23 +181,6 @@ clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *virtual
|
||||
slot);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_virtual_input_device_get_manager:
|
||||
* @virtual_device: a virtual device
|
||||
*
|
||||
* Gets the device manager of this virtual device.
|
||||
*
|
||||
* Returns: (transfer none): The #ClutterDeviceManager of this virtual device
|
||||
**/
|
||||
ClutterDeviceManager *
|
||||
clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device)
|
||||
{
|
||||
ClutterVirtualInputDevicePrivate *priv =
|
||||
clutter_virtual_input_device_get_instance_private (virtual_device);
|
||||
|
||||
return priv->manager;
|
||||
}
|
||||
|
||||
int
|
||||
clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device)
|
||||
{
|
||||
@ -220,8 +203,8 @@ clutter_virtual_input_device_get_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DEVICE_MANAGER:
|
||||
g_value_set_object (value, priv->manager);
|
||||
case PROP_SEAT:
|
||||
g_value_set_object (value, priv->seat);
|
||||
break;
|
||||
case PROP_DEVICE_TYPE:
|
||||
g_value_set_enum (value, priv->device_type);
|
||||
@ -245,8 +228,8 @@ clutter_virtual_input_device_set_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_DEVICE_MANAGER:
|
||||
priv->manager = g_value_get_object (value);
|
||||
case PROP_SEAT:
|
||||
priv->seat = g_value_get_object (value);
|
||||
break;
|
||||
case PROP_DEVICE_TYPE:
|
||||
priv->device_type = g_value_get_enum (value);
|
||||
@ -270,11 +253,11 @@ clutter_virtual_input_device_class_init (ClutterVirtualInputDeviceClass *klass)
|
||||
object_class->get_property = clutter_virtual_input_device_get_property;
|
||||
object_class->set_property = clutter_virtual_input_device_set_property;
|
||||
|
||||
obj_props[PROP_DEVICE_MANAGER] =
|
||||
g_param_spec_object ("device-manager",
|
||||
P_("Device Manager"),
|
||||
P_("The device manager instance"),
|
||||
CLUTTER_TYPE_DEVICE_MANAGER,
|
||||
obj_props[PROP_SEAT] =
|
||||
g_param_spec_object ("seat",
|
||||
P_("Seat"),
|
||||
P_("Seat"),
|
||||
CLUTTER_TYPE_SEAT,
|
||||
CLUTTER_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
|
||||
obj_props[PROP_DEVICE_TYPE] =
|
||||
g_param_spec_enum ("device-type",
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <glib-object.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "clutter-device-manager.h"
|
||||
#include "clutter-seat.h"
|
||||
|
||||
#define CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE (clutter_virtual_input_device_get_type ())
|
||||
|
||||
@ -169,9 +169,6 @@ void clutter_virtual_input_device_notify_touch_up (ClutterVirtualInputDevice *vi
|
||||
uint64_t time_us,
|
||||
int slot);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
ClutterDeviceManager * clutter_virtual_input_device_get_manager (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
CLUTTER_EXPORT
|
||||
int clutter_virtual_input_device_get_device_type (ClutterVirtualInputDevice *virtual_device);
|
||||
|
||||
|
@ -2233,11 +2233,15 @@ meta_input_settings_emulate_keybinding (MetaInputSettings *input_settings,
|
||||
|
||||
if (!priv->virtual_pad_keyboard)
|
||||
{
|
||||
ClutterDeviceManager *manager = clutter_device_manager_get_default ();
|
||||
ClutterBackend *backend;
|
||||
ClutterSeat *seat;
|
||||
|
||||
backend = clutter_get_default_backend ();
|
||||
seat = clutter_backend_get_default_seat (backend);
|
||||
|
||||
priv->virtual_pad_keyboard =
|
||||
clutter_device_manager_create_virtual_device (manager,
|
||||
CLUTTER_KEYBOARD_DEVICE);
|
||||
clutter_seat_create_virtual_device (seat,
|
||||
CLUTTER_KEYBOARD_DEVICE);
|
||||
}
|
||||
|
||||
state = is_press ? CLUTTER_KEY_STATE_PRESSED : CLUTTER_KEY_STATE_RELEASED;
|
||||
|
@ -116,8 +116,8 @@ static gboolean
|
||||
meta_remote_desktop_session_start (MetaRemoteDesktopSession *session,
|
||||
GError **error)
|
||||
{
|
||||
ClutterDeviceManager *device_manager =
|
||||
clutter_device_manager_get_default ();
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
ClutterSeat *seat = clutter_backend_get_default_seat (backend);
|
||||
|
||||
g_assert (!session->virtual_pointer && !session->virtual_keyboard);
|
||||
|
||||
@ -128,15 +128,11 @@ meta_remote_desktop_session_start (MetaRemoteDesktopSession *session,
|
||||
}
|
||||
|
||||
session->virtual_pointer =
|
||||
clutter_device_manager_create_virtual_device (device_manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
clutter_seat_create_virtual_device (seat, CLUTTER_POINTER_DEVICE);
|
||||
session->virtual_keyboard =
|
||||
clutter_device_manager_create_virtual_device (device_manager,
|
||||
CLUTTER_KEYBOARD_DEVICE);
|
||||
|
||||
clutter_seat_create_virtual_device (seat, CLUTTER_KEYBOARD_DEVICE);
|
||||
session->virtual_touchscreen =
|
||||
clutter_device_manager_create_virtual_device (device_manager,
|
||||
CLUTTER_TOUCHSCREEN_DEVICE);
|
||||
clutter_seat_create_virtual_device (seat, CLUTTER_TOUCHSCREEN_DEVICE);
|
||||
|
||||
init_remote_access_handle (session);
|
||||
|
||||
|
@ -234,14 +234,14 @@ meta_remote_desktop_new (MetaDbusSessionWatcher *session_watcher)
|
||||
static MetaRemoteDesktopDeviceTypes
|
||||
calculate_supported_device_types (void)
|
||||
{
|
||||
ClutterDeviceManager *device_manager =
|
||||
clutter_device_manager_get_default ();
|
||||
ClutterBackend *backend = clutter_get_default_backend ();
|
||||
ClutterSeat *seat = clutter_backend_get_default_seat (backend);
|
||||
ClutterVirtualDeviceType device_types;
|
||||
MetaRemoteDesktopDeviceTypes supported_devices =
|
||||
META_REMOTE_DESKTOP_DEVICE_TYPE_NONE;
|
||||
|
||||
device_types =
|
||||
clutter_device_manager_get_supported_virtual_device_types (device_manager);
|
||||
clutter_seat_get_supported_virtual_device_types (seat);
|
||||
|
||||
if (device_types & CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD)
|
||||
supported_devices |= META_REMOTE_DESKTOP_DEVICE_TYPE_KEYBOARD;
|
||||
|
@ -188,8 +188,6 @@ meta_device_manager_native_class_init (MetaDeviceManagerNativeClass *klass)
|
||||
manager_class->get_devices = meta_device_manager_native_get_devices;
|
||||
manager_class->get_core_device = meta_device_manager_native_get_core_device;
|
||||
manager_class->get_device = meta_device_manager_native_get_device;
|
||||
manager_class->create_virtual_device = meta_device_manager_native_create_virtual_device;
|
||||
manager_class->get_supported_virtual_device_types = meta_device_manager_native_get_supported_virtual_device_types;
|
||||
manager_class->compress_motion = meta_device_manager_native_compress_motion;
|
||||
}
|
||||
|
||||
|
@ -851,7 +851,6 @@ static void
|
||||
enable_mousekeys (MetaInputDeviceNative *device_evdev)
|
||||
{
|
||||
ClutterInputDevice *device = CLUTTER_INPUT_DEVICE (device_evdev);
|
||||
ClutterDeviceManager *manager = device->device_manager;
|
||||
|
||||
device_evdev->mousekeys_btn = CLUTTER_BUTTON_PRIMARY;
|
||||
device_evdev->move_mousekeys_timer = 0;
|
||||
@ -863,8 +862,8 @@ enable_mousekeys (MetaInputDeviceNative *device_evdev)
|
||||
return;
|
||||
|
||||
device->accessibility_virtual_device =
|
||||
clutter_device_manager_create_virtual_device (manager,
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
clutter_seat_create_virtual_device (CLUTTER_SEAT (device_evdev->seat),
|
||||
CLUTTER_POINTER_DEVICE);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -37,6 +37,7 @@
|
||||
#include "backends/native/meta-input-device-native.h"
|
||||
#include "backends/native/meta-input-device-tool-native.h"
|
||||
#include "backends/native/meta-keymap-native.h"
|
||||
#include "backends/native/meta-virtual-input-device-native.h"
|
||||
#include "clutter/clutter-mutter.h"
|
||||
#include "core/bell.h"
|
||||
|
||||
@ -2568,6 +2569,24 @@ meta_seat_native_apply_kbd_a11y_settings (ClutterSeat *seat,
|
||||
settings);
|
||||
}
|
||||
|
||||
static ClutterVirtualInputDevice *
|
||||
meta_seat_native_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
return g_object_new (META_TYPE_VIRTUAL_INPUT_DEVICE_NATIVE,
|
||||
"seat", seat,
|
||||
"device-type", device_type,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static ClutterVirtualDeviceType
|
||||
meta_seat_native_get_supported_virtual_device_types (ClutterSeat *seat)
|
||||
{
|
||||
return (CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD |
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER |
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_TOUCHSCREEN);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_seat_native_class_init (MetaSeatNativeClass *klass)
|
||||
{
|
||||
@ -2588,6 +2607,8 @@ meta_seat_native_class_init (MetaSeatNativeClass *klass)
|
||||
seat_class->copy_event_data = meta_seat_native_copy_event_data;
|
||||
seat_class->free_event_data = meta_seat_native_free_event_data;
|
||||
seat_class->apply_kbd_a11y_settings = meta_seat_native_apply_kbd_a11y_settings;
|
||||
seat_class->create_virtual_device = meta_seat_native_create_virtual_device;
|
||||
seat_class->get_supported_virtual_device_types = meta_seat_native_get_supported_virtual_device_types;
|
||||
|
||||
props[PROP_SEAT_ID] =
|
||||
g_param_spec_string ("seat-id",
|
||||
|
@ -228,23 +228,6 @@ meta_device_manager_x11_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static ClutterVirtualInputDevice *
|
||||
meta_device_manager_x11_create_virtual_device (ClutterDeviceManager *manager,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
return g_object_new (META_TYPE_VIRTUAL_INPUT_DEVICE_X11,
|
||||
"device-manager", manager,
|
||||
"device-type", device_type,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static ClutterVirtualDeviceType
|
||||
meta_device_manager_x11_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
|
||||
{
|
||||
return (CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD |
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_device_manager_x11_class_init (MetaDeviceManagerX11Class *klass)
|
||||
{
|
||||
@ -271,8 +254,6 @@ meta_device_manager_x11_class_init (MetaDeviceManagerX11Class *klass)
|
||||
manager_class->get_core_device = meta_device_manager_x11_get_core_device;
|
||||
manager_class->get_device = meta_device_manager_x11_get_device;
|
||||
manager_class->select_stage_events = meta_device_manager_x11_select_stage_events;
|
||||
manager_class->create_virtual_device = meta_device_manager_x11_create_virtual_device;
|
||||
manager_class->get_supported_virtual_device_types = meta_device_manager_x11_get_supported_virtual_device_types;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "backends/x11/meta-input-device-x11.h"
|
||||
#include "backends/x11/meta-keymap-x11.h"
|
||||
#include "backends/x11/meta-stage-x11.h"
|
||||
#include "backends/x11/meta-virtual-input-device-x11.h"
|
||||
#include "backends/x11/meta-xkb-a11y-x11.h"
|
||||
#include "clutter/clutter-mutter.h"
|
||||
#include "clutter/x11/clutter-x11.h"
|
||||
@ -1482,6 +1483,23 @@ meta_seat_x11_free_event_data (ClutterSeat *seat,
|
||||
meta_event_x11_free (event_x11);
|
||||
}
|
||||
|
||||
static ClutterVirtualInputDevice *
|
||||
meta_seat_x11_create_virtual_device (ClutterSeat *seat,
|
||||
ClutterInputDeviceType device_type)
|
||||
{
|
||||
return g_object_new (META_TYPE_VIRTUAL_INPUT_DEVICE_X11,
|
||||
"seat", seat,
|
||||
"device-type", device_type,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static ClutterVirtualDeviceType
|
||||
meta_seat_x11_get_supported_virtual_device_types (ClutterSeat *seat)
|
||||
{
|
||||
return (CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD |
|
||||
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER);
|
||||
}
|
||||
|
||||
static void
|
||||
meta_seat_x11_class_init (MetaSeatX11Class *klass)
|
||||
{
|
||||
@ -1501,6 +1519,8 @@ meta_seat_x11_class_init (MetaSeatX11Class *klass)
|
||||
seat_class->copy_event_data = meta_seat_x11_copy_event_data;
|
||||
seat_class->free_event_data = meta_seat_x11_free_event_data;
|
||||
seat_class->apply_kbd_a11y_settings = meta_seat_x11_apply_kbd_a11y_settings;
|
||||
seat_class->create_virtual_device = meta_seat_x11_create_virtual_device;
|
||||
seat_class->get_supported_virtual_device_types = meta_seat_x11_get_supported_virtual_device_types;
|
||||
|
||||
props[PROP_OPCODE] =
|
||||
g_param_spec_int ("opcode",
|
||||
|
Loading…
Reference in New Issue
Block a user