[gnome-settings-daemon/wip/hadess/old-xlibs-removal: 1/5] power: Remove touchscreen disable for DPMS
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon/wip/hadess/old-xlibs-removal: 1/5] power: Remove touchscreen disable for DPMS
- Date: Thu, 25 Oct 2018 11:33:28 +0000 (UTC)
commit 9c8ef14fc8812694ba0afcff2f34e3e75a2a05e4
Author: Bastien Nocera <hadess hadess net>
Date: Thu Oct 25 13:17:13 2018 +0200
power: Remove touchscreen disable for DPMS
It only worked for X11, and the feature is now available for both X11
and Wayland in mutter directly.
FIXME: Add mutter reference
plugins/common/gsd-input-helper.c | 23 --------------
plugins/common/gsd-input-helper.h | 3 --
plugins/power/gsd-power-manager.c | 65 ---------------------------------------
3 files changed, 91 deletions(-)
---
diff --git a/plugins/common/gsd-input-helper.c b/plugins/common/gsd-input-helper.c
index 41005999..3a7c4ce5 100644
--- a/plugins/common/gsd-input-helper.c
+++ b/plugins/common/gsd-input-helper.c
@@ -316,29 +316,6 @@ out:
return id;
}
-gboolean
-set_device_enabled (int device_id,
- gboolean enabled)
-{
- Atom prop;
- guchar value;
-
- prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Device Enabled", False);
- if (!prop)
- return FALSE;
-
- gdk_error_trap_push ();
-
- value = enabled ? 1 : 0;
- XIChangeProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
- device_id, prop, XA_INTEGER, 8, PropModeReplace, &value, 1);
-
- if (gdk_error_trap_pop ())
- return FALSE;
-
- return TRUE;
-}
-
const char *
xdevice_get_wacom_tool_type (int deviceid)
{
diff --git a/plugins/common/gsd-input-helper.h b/plugins/common/gsd-input-helper.h
index 31e2e47a..c13726b2 100644
--- a/plugins/common/gsd-input-helper.h
+++ b/plugins/common/gsd-input-helper.h
@@ -47,9 +47,6 @@ typedef struct {
gboolean supports_xinput2_devices (int *opcode);
gboolean supports_xtest (void);
-gboolean set_device_enabled (int device_id,
- gboolean enabled);
-
gboolean touchpad_is_present (void);
gboolean touchscreen_is_present (void);
gboolean mouse_is_present (void);
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 6c417721..2d027c2f 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -141,7 +141,6 @@ struct GsdPowerManagerPrivate
/* Screensaver */
GsdScreenSaver *screensaver_proxy;
gboolean screensaver_active;
- GHashTable *disabled_devices;
/* State */
gboolean lid_is_present;
@@ -984,61 +983,6 @@ action_hibernate (GsdPowerManager *manager)
"Error calling Hibernate");
}
-static void
-screen_devices_disable (GsdPowerManager *manager)
-{
- GdkDeviceManager *device_manager;
- GList *devices, *l;
-
- /* This will be managed by the compositor eventually on X11 too:
- * https://bugzilla.gnome.org/show_bug.cgi?id=742598
- */
- 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);
- for (l = devices; l != NULL; l = l->next ) {
- GdkDevice *device = l->data;
- GdkInputSource source;
-
- source = gdk_device_get_source (device);
-
- 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);
- g_hash_table_insert (manager->priv->disabled_devices,
- GINT_TO_POINTER (device_id),
- GINT_TO_POINTER (TRUE));
- }
- }
- g_list_free (devices);
-
- devices = g_hash_table_get_keys (manager->priv->disabled_devices);
- for (l = devices; l != NULL; l = l->next)
- set_device_enabled (GPOINTER_TO_INT (l->data), FALSE);
- g_list_free (devices);
-}
-
-static void
-screen_devices_enable (GsdPowerManager *manager)
-{
- GList *l, *disabled_devices;
-
- if (gnome_settings_is_wayland ())
- return;
-
- disabled_devices = g_hash_table_get_keys (manager->priv->disabled_devices);
- for (l = disabled_devices; l != NULL; l = l->next)
- set_device_enabled (GPOINTER_TO_INT (l->data), TRUE);
- g_list_free (disabled_devices);
-
- g_hash_table_remove_all (manager->priv->disabled_devices);
-}
-
static void
iio_proxy_claim_light (GsdPowerManager *manager, gboolean active)
{
@@ -1093,8 +1037,6 @@ backlight_enable (GsdPowerManager *manager)
g_error_free (error);
}
- screen_devices_enable (manager);
-
g_debug ("TESTSUITE: Unblanked screen");
}
@@ -1117,8 +1059,6 @@ backlight_disable (GsdPowerManager *manager)
g_debug("Is tablet: %d", manager->priv->is_tablet);
if (manager->priv->is_tablet)
action_suspend (manager);
- else
- screen_devices_disable (manager);
g_debug ("TESTSUITE: Blanked screen");
}
@@ -1946,8 +1886,6 @@ gsd_power_manager_finalize (GObject *object)
gsd_power_manager_stop (manager);
- g_clear_pointer (&manager->priv->disabled_devices, g_hash_table_unref);
-
g_clear_object (&manager->priv->connection);
if (manager->priv->name_id != 0)
@@ -2725,8 +2663,6 @@ gsd_power_manager_stop (GsdPowerManager *manager)
{
g_debug ("Stopping power manager");
- screen_devices_enable (manager);
-
if (manager->priv->inhibit_lid_switch_timer_id != 0) {
g_source_remove (manager->priv->inhibit_lid_switch_timer_id);
manager->priv->inhibit_lid_switch_timer_id = 0;
@@ -2788,7 +2724,6 @@ gsd_power_manager_init (GsdPowerManager *manager)
manager->priv->inhibit_lid_switch_fd = -1;
manager->priv->inhibit_suspend_fd = -1;
manager->priv->cancellable = g_cancellable_new ();
- manager->priv->disabled_devices = g_hash_table_new (g_direct_hash, g_direct_equal);
}
/* returns new level */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]