summaryrefslogtreecommitdiff
path: root/panels/common/gsd-device-manager.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2016-06-06 14:06:57 +0200
committerCarlos Garnacho <carlosg@gnome.org>2016-11-04 23:26:41 +0100
commit3db9203dd28eaccb68e315daf46e1625d7aaa51f (patch)
tree10b454378287ead3147dbbfd6876cf4cf10d9093 /panels/common/gsd-device-manager.c
parent0a6219886bc6cd185e460f20a17dac3e15dd32e9 (diff)
downloadgnome-control-center-3db9203dd28eaccb68e315daf46e1625d7aaa51f.tar.gz
common: Add generic API to map GdkDevices to GsdDevices
Now that we have tablet support in wayland, we can kind of honor that in the places we're interested. The inverse (looking up the GdkDevices that a single GsdDevice represents) is unneeded.
Diffstat (limited to 'panels/common/gsd-device-manager.c')
-rw-r--r--panels/common/gsd-device-manager.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/panels/common/gsd-device-manager.c b/panels/common/gsd-device-manager.c
index 1737bf333..541f29487 100644
--- a/panels/common/gsd-device-manager.c
+++ b/panels/common/gsd-device-manager.c
@@ -415,3 +415,19 @@ gsd_device_get_dimensions (GsdDevice *device,
return priv->width > 0 && priv->height > 0;
}
+
+GsdDevice *
+gsd_device_manager_lookup_gdk_device (GsdDeviceManager *manager,
+ GdkDevice *gdk_device)
+{
+ GsdDeviceManagerClass *klass;
+
+ g_return_val_if_fail (GSD_IS_DEVICE_MANAGER (manager), NULL);
+ g_return_val_if_fail (GDK_IS_DEVICE (gdk_device), NULL);
+
+ klass = GSD_DEVICE_MANAGER_GET_CLASS (manager);
+ if (!klass->lookup_device)
+ return NULL;
+
+ return klass->lookup_device (manager, gdk_device);
+}