[gnome-settings-daemon/wip/settings-relocation: 3/10] power: Restrict disabling of touchscreens/tablets to X11
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/settings-relocation: 3/10] power: Restrict disabling of touchscreens/tablets to X11
- Date: Thu, 18 Dec 2014 17:09:43 +0000 (UTC)
commit 5594c50fcebe5596b8a2a1c7ff47795e08cb7ead
Author: Carlos Garnacho <carlosg gnome org>
Date: Wed Dec 17 14:10:48 2014 +0100
power: Restrict disabling of touchscreens/tablets to X11
This should be eventually done by the compositor. In the mean time, restrict
it to X11, and remove the GsdDeviceMapper usage, as it's not strictly
necessary.
plugins/power/gsd-power-manager.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 13c34f3..9ee546e 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -921,18 +921,24 @@ action_hibernate (GsdPowerManager *manager)
static void
screen_devices_disable (GsdPowerManager *manager)
{
- GsdDeviceMapper *mapper;
GdkDeviceManager *device_manager;
GList *devices, *l, *to_change;
- mapper = gsd_device_mapper_get ();
+ if (gnome_settings_is_wayland ())
+ return;
+
device_manager = gdk_display_get_device_manager (gdk_display_get_default ());
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE);
to_change = NULL;
for (l = devices; l != NULL; l = l->next ) {
GdkDevice *device = l->data;
+ GdkInputSource source;
+
+ source = gdk_device_get_source (device);
- if (gsd_device_mapper_get_device_output (mapper, device) != NULL) {
+ if (source == GDK_SOURCE_PEN ||
+ source == GDK_SOURCE_ERASER ||
+ source == GDK_SOURCE_TOUCHSCREEN) {
int device_id;
g_object_get (device, "device-id", &device_id, NULL);
@@ -953,6 +959,9 @@ screen_devices_enable (GsdPowerManager *manager)
{
GList *l;
+ if (gnome_settings_is_wayland ())
+ return;
+
for (l = manager->priv->disabled_devices; l != NULL; l = l->next)
set_device_enabled (GPOINTER_TO_INT (l->data), TRUE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]