summaryrefslogtreecommitdiff
path: root/src/backends/meta-remote-desktop.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backends/meta-remote-desktop.c')
-rw-r--r--src/backends/meta-remote-desktop.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/backends/meta-remote-desktop.c b/src/backends/meta-remote-desktop.c
index 38dbb57ae..1282818c0 100644
--- a/src/backends/meta-remote-desktop.c
+++ b/src/backends/meta-remote-desktop.c
@@ -43,6 +43,14 @@
#define META_REMOTE_DESKTOP_DBUS_SERVICE "org.gnome.Mutter.RemoteDesktop"
#define META_REMOTE_DESKTOP_DBUS_PATH "/org/gnome/Mutter/RemoteDesktop"
+typedef enum _MetaRemoteDesktopDeviceTypes
+{
+ META_REMOTE_DESKTOP_DEVICE_TYPE_NONE = 0,
+ META_REMOTE_DESKTOP_DEVICE_TYPE_KEYBOARD = 1 << 0,
+ META_REMOTE_DESKTOP_DEVICE_TYPE_POINTER = 1 << 1,
+ META_REMOTE_DESKTOP_DEVICE_TYPE_TOUCHSCREEN = 1 << 2,
+} MetaRemoteDesktopDeviceTypes;
+
struct _MetaRemoteDesktop
{
MetaDBusRemoteDesktopSkeleton parent;
@@ -224,10 +232,36 @@ meta_remote_desktop_new (MetaDbusSessionWatcher *session_watcher)
return remote_desktop;
}
+static MetaRemoteDesktopDeviceTypes
+calculate_supported_device_types (void)
+{
+ ClutterDeviceManager *device_manager =
+ clutter_device_manager_get_default ();
+ ClutterVirtualDeviceType device_types;
+ MetaRemoteDesktopDeviceTypes supported_devices =
+ META_REMOTE_DESKTOP_DEVICE_TYPE_NONE;
+
+ device_types =
+ clutter_device_manager_get_supported_virtual_device_types (device_manager);
+
+ if (device_types & CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD)
+ supported_devices |= META_REMOTE_DESKTOP_DEVICE_TYPE_KEYBOARD;
+ if (device_types & CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER)
+ supported_devices |= META_REMOTE_DESKTOP_DEVICE_TYPE_POINTER;
+ if (device_types & CLUTTER_VIRTUAL_DEVICE_TYPE_TOUCHSCREEN)
+ supported_devices |= META_REMOTE_DESKTOP_DEVICE_TYPE_TOUCHSCREEN;
+
+ return supported_devices;
+}
+
static void
meta_remote_desktop_init (MetaRemoteDesktop *remote_desktop)
{
remote_desktop->sessions = g_hash_table_new (g_str_hash, g_str_equal);
+
+ meta_dbus_remote_desktop_set_supported_device_types (
+ META_DBUS_REMOTE_DESKTOP (remote_desktop),
+ calculate_supported_device_types ());
}
static void