[gnome-settings-daemon] plugins: Fix commit c010d79dd447e5bd60f6bf6a224561cf7604e585
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] plugins: Fix commit c010d79dd447e5bd60f6bf6a224561cf7604e585
- Date: Tue, 15 Mar 2011 13:21:12 +0000 (UTC)
commit 62ff9404e0a9dc2053955ac2775d3cf36ee57fb5
Author: Bastien Nocera <hadess hadess net>
Date: Tue Mar 15 13:20:00 2011 +0000
plugins: Fix commit c010d79dd447e5bd60f6bf6a224561cf7604e585
We need to disconnect the signal handlers by hand, as the
lifetime of the GdkDeviceManager is the same as the display,
so it would be possible for devices to be added while we're
shutting down, or when a plugin has already been disposed of.
plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c | 10 ++++++++--
plugins/mouse/gsd-mouse-manager.c | 13 +++++++++----
plugins/wacom/gsd-wacom-manager.c | 10 ++++++++--
3 files changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
index 6b7f94f..7bf8d6a 100644
--- a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
+++ b/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c
@@ -54,6 +54,7 @@ struct GsdA11yKeyboardManagerPrivate
{
int xkbEventBase;
GdkDeviceManager *device_manager;
+ guint device_added_id;
gboolean stickykeys_shortcut_val;
gboolean slowkeys_shortcut_val;
GtkWidget *stickykeys_alert;
@@ -103,8 +104,8 @@ set_devicepresence_handler (GsdA11yKeyboardManager *manager)
return;
manager->priv->device_manager = device_manager;
- g_signal_connect (G_OBJECT (device_manager), "device-added",
- G_CALLBACK (device_added_cb), manager);
+ manager->priv->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
+ G_CALLBACK (device_added_cb), manager);
}
static gboolean
@@ -1019,6 +1020,11 @@ gsd_a11y_keyboard_manager_stop (GsdA11yKeyboardManager *manager)
g_debug ("Stopping a11y_keyboard manager");
+ if (p->device_manager != NULL) {
+ g_signal_handler_disconnect (p->device_manager, p->device_added_id);
+ p->device_manager = NULL;
+ }
+
if (p->status_icon) {
gtk_status_icon_set_visible (p->status_icon, FALSE);
p->status_icon = NULL;
diff --git a/plugins/mouse/gsd-mouse-manager.c b/plugins/mouse/gsd-mouse-manager.c
index a647b9a..085d793 100644
--- a/plugins/mouse/gsd-mouse-manager.c
+++ b/plugins/mouse/gsd-mouse-manager.c
@@ -76,9 +76,9 @@ struct GsdMouseManagerPrivate
{
GSettings *touchpad_settings;
GSettings *mouse_settings;
- GSettings *mouse_a11y_settings;
+ GSettings *mouse_a11y_settings;
GdkDeviceManager *device_manager;
- guint notify;
+ guint device_added_id;
gboolean mousetweaks_daemon_running;
gboolean syndaemon_spawned;
@@ -378,8 +378,8 @@ set_devicepresence_handler (GsdMouseManager *manager)
if (device_manager == NULL)
return;
- g_signal_connect (G_OBJECT (device_manager), "device-added",
- G_CALLBACK (device_added_cb), manager);
+ manager->priv->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
+ G_CALLBACK (device_added_cb), manager);
manager->priv->device_manager = device_manager;
}
@@ -1011,6 +1011,11 @@ gsd_mouse_manager_stop (GsdMouseManager *manager)
g_debug ("Stopping mouse manager");
+ if (p->device_manager != NULL) {
+ g_signal_handler_disconnect (p->device_manager, p->device_added_id);
+ p->device_manager = NULL;
+ }
+
if (p->mouse_settings != NULL) {
g_object_unref (p->mouse_settings);
p->mouse_settings = NULL;
diff --git a/plugins/wacom/gsd-wacom-manager.c b/plugins/wacom/gsd-wacom-manager.c
index 0ccfde6..0d616e7 100644
--- a/plugins/wacom/gsd-wacom-manager.c
+++ b/plugins/wacom/gsd-wacom-manager.c
@@ -81,6 +81,7 @@ struct GsdWacomManagerPrivate
GSettings *cursor_settings;
GSettings *pad_settings;
GdkDeviceManager *device_manager;
+ guint device_added_id;
};
static void gsd_wacom_manager_class_init (GsdWacomManagerClass *klass);
@@ -143,8 +144,8 @@ set_devicepresence_handler (GsdWacomManager *manager)
if (device_manager == NULL)
return;
- g_signal_connect (G_OBJECT (device_manager), "device-added",
- G_CALLBACK (device_added_cb), manager);
+ manager->priv->device_added_id = g_signal_connect (G_OBJECT (device_manager), "device-added",
+ G_CALLBACK (device_added_cb), manager);
manager->priv->device_manager = device_manager;
}
@@ -596,6 +597,11 @@ gsd_wacom_manager_stop (GsdWacomManager *manager)
g_debug ("Stopping wacom manager");
+ if (p->device_manager != NULL) {
+ g_signal_handler_disconnect (p->device_manager, p->device_added_id);
+ p->device_manager = NULL;
+ }
+
if (p->wacom_settings != NULL) {
g_object_unref (p->wacom_settings);
p->wacom_settings = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]