diff --git a/0001-power-Don-t-forget-about-disabled-touchscreens.patch b/0001-power-Don-t-forget-about-disabled-touchscreens.patch new file mode 100644 index 0000000..9a3c95b --- /dev/null +++ b/0001-power-Don-t-forget-about-disabled-touchscreens.patch @@ -0,0 +1,101 @@ +From 456ce166b43e11edd900d43ec76879b93659d60a Mon Sep 17 00:00:00 2001 +From: Bastien Nocera +Date: Tue, 20 Jan 2015 16:58:16 +0100 +Subject: [PATCH] power: Don't forget about disabled touchscreens + +When blanking the screen twice, which can happen when suspending, +don't forget about previously disabled touchscreens. + +See https://bugzilla.redhat.com/show_bug.cgi?id=1173849 + +https://bugzilla.gnome.org/show_bug.cgi?id=743252 +--- + plugins/power/gsd-power-manager.c | 27 ++++++++++++++++----------- + 1 file changed, 16 insertions(+), 11 deletions(-) + +diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c +index 0c2469d..b31ec6d 100644 +--- a/plugins/power/gsd-power-manager.c ++++ b/plugins/power/gsd-power-manager.c +@@ -129,7 +129,7 @@ struct GsdPowerManagerPrivate + /* Screensaver */ + GsdScreenSaver *screensaver_proxy; + gboolean screensaver_active; +- GList *disabled_devices; ++ GHashTable *disabled_devices; + + /* State */ + gboolean lid_is_present; +@@ -921,12 +921,11 @@ screen_devices_disable (GsdPowerManager *manager) + { + GsdDeviceMapper *mapper; + GdkDeviceManager *device_manager; +- GList *devices, *l, *to_change; ++ GList *devices, *l; + + mapper = gsd_device_mapper_get (); + 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; + +@@ -934,27 +933,30 @@ screen_devices_disable (GsdPowerManager *manager) + int device_id; + + g_object_get (device, "device-id", &device_id, NULL); +- to_change = g_list_prepend (to_change, GINT_TO_POINTER (device_id)); ++ g_hash_table_insert (manager->priv->disabled_devices, ++ GINT_TO_POINTER (device_id), ++ GINT_TO_POINTER (TRUE)); + } + } + g_list_free (devices); + +- for (l = to_change; l != NULL; l = l->next) ++ 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_clear_pointer (&manager->priv->disabled_devices, g_list_free); +- manager->priv->disabled_devices = to_change; ++ g_list_free (devices); + } + + static void + screen_devices_enable (GsdPowerManager *manager) + { +- GList *l; ++ GList *l, *disabled_devices; + +- for (l = manager->priv->disabled_devices; l != NULL; l = l->next) ++ 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_clear_pointer (&manager->priv->disabled_devices, g_list_free); ++ g_hash_table_remove_all (manager->priv->disabled_devices); + } + + static void +@@ -1828,6 +1830,8 @@ 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) +@@ -2521,6 +2525,7 @@ gsd_power_manager_init (GsdPowerManager *manager) + manager->priv->inhibit_lid_switch_fd = -1; + manager->priv->inhibit_suspend_fd = -1; + manager->priv->bus_cancellable = g_cancellable_new (); ++ manager->priv->disabled_devices = g_hash_table_new (g_direct_hash, g_direct_equal); + } + + /* returns new level */ +-- +2.1.0 + diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index 0b2b09f..8000b7f 100644 --- a/gnome-settings-daemon.spec +++ b/gnome-settings-daemon.spec @@ -7,7 +7,7 @@ Name: gnome-settings-daemon Version: 3.14.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications Group: System Environment/Daemons @@ -18,6 +18,8 @@ Source: http://download.gnome.org/sources/%{name}/3.14/%{name}-%{version # disable wacom for ppc/ppc64 (used on RHEL) Patch0: %{name}-3.5.4-ppc-no-wacom.patch +Patch1: 0001-power-Don-t-forget-about-disabled-touchscreens.patch + BuildRequires: gtk3-devel >= %{gtk3_version} BuildRequires: gnome-desktop3-devel >= %{gnome_desktop_version} BuildRequires: xorg-x11-proto-devel libXxf86misc-devel @@ -93,6 +95,8 @@ developing applications that use %{name}. autoreconf -i -f +%patch1 -p1 + %build %configure --disable-static \ %if 0%{?rhel} @@ -261,6 +265,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || : %{_libexecdir}/gsd-test-xsettings %changelog +* Tue Jan 20 2015 Bastien Nocera 3.14.2-2 +- Fix disabled touchscreens when resuming from suspend (#1173849) + * Tue Nov 11 2014 Kalev Lember - 3.14.2-1 - Update to 3.14.2