Towards a working gsd

This commit is contained in:
Matthias Clasen 2012-01-20 14:05:11 -05:00
parent 2a31ee4d39
commit 7b980256bf
5 changed files with 144 additions and 1 deletions

View File

@ -0,0 +1,31 @@
From ae303fb2b05265888f8b65ba2236782693369da7 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 20 Jan 2012 09:11:14 -0500
Subject: [PATCH] Media keys: Be more careful when shutting down
The gtksettings instance is also initialized in an idle, so
we must handle it still being NULL when we shut down.
---
plugins/media-keys/gsd-media-keys-manager.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index e4052f3..51053ea 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2147,8 +2147,10 @@ gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
manager);
}
- g_signal_handlers_disconnect_by_func (manager->priv->gtksettings, sound_theme_changed, manager);
- manager->priv->gtksettings = NULL;
+ if (manager->priv->gtksettings != NULL) {
+ g_signal_handlers_disconnect_by_func (manager->priv->gtksettings, sound_theme_changed, manager);
+ manager->priv->gtksettings = NULL;
+ }
if (manager->priv->ca) {
ca_context_destroy (manager->priv->ca);
--
1.7.8.4

View File

@ -0,0 +1,26 @@
From f84c73599aa7c7c6bba94471dc445dbbea521f72 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 20 Jan 2012 00:40:41 -0500
Subject: [PATCH] Updates: Don't call g_object_unref on a GPtrArray
It doesn't work.
---
plugins/updates/gsd-updates-firmware.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/updates/gsd-updates-firmware.c b/plugins/updates/gsd-updates-firmware.c
index 17ca804..a04ad27 100644
--- a/plugins/updates/gsd-updates-firmware.c
+++ b/plugins/updates/gsd-updates-firmware.c
@@ -493,7 +493,7 @@ out:
if (error_code != NULL)
g_object_unref (error_code);
if (array != NULL)
- g_object_unref (array);
+ g_ptr_array_unref (array);
if (results != NULL)
g_object_unref (results);
return item;
--
1.7.8.4

View File

@ -0,0 +1,28 @@
From c16d6d46dfdeff509b888140d4fa1a04888ca355 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 20 Jan 2012 09:06:08 -0500
Subject: [PATCH] XSettings: be more careful when shutting down
The shell name watch_id may still be 0 when we shut down right
away, because another instance is already running.
---
plugins/xsettings/gsd-xsettings-manager.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/plugins/xsettings/gsd-xsettings-manager.c b/plugins/xsettings/gsd-xsettings-manager.c
index 075cb37..fa49a3e 100644
--- a/plugins/xsettings/gsd-xsettings-manager.c
+++ b/plugins/xsettings/gsd-xsettings-manager.c
@@ -929,7 +929,8 @@ gnome_xsettings_manager_stop (GnomeXSettingsManager *manager)
stop_fontconfig_monitor (manager);
- g_bus_unwatch_name (manager->priv->shell_name_watch_id);
+ if (manager->priv->shell_name_watch_id > 0)
+ g_bus_unwatch_name (manager->priv->shell_name_watch_id);
if (p->settings != NULL) {
g_hash_table_destroy (p->settings);
--
1.7.8.4

View File

@ -0,0 +1,45 @@
From 42f9427729d763e7fd62aec9e15b036531489682 Mon Sep 17 00:00:00 2001
From: Matthias Clasen <mclasen@redhat.com>
Date: Fri, 20 Jan 2012 09:00:54 -0500
Subject: [PATCH] media-keys: Be more careful when finalizing
The keys array is initalized in an idle, so if we go right back down
because another instance of gsd is already running, we crash in
finalize, trying to clear a nonexisting array.
---
plugins/media-keys/gsd-media-keys-manager.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 14ff09f..61e3a56 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -2209,16 +2209,18 @@ gsd_media_keys_manager_stop (GsdMediaKeysManager *manager)
gdk_error_trap_push ();
- for (i = 0; i < priv->keys->len; ++i) {
- MediaKey *key;
+ if (priv->keys != NULL) {
+ for (i = 0; i < priv->keys->len; ++i) {
+ MediaKey *key;
- key = g_ptr_array_index (manager->priv->keys, i);
+ key = g_ptr_array_index (manager->priv->keys, i);
- if (key->key)
- grab_key_unsafe (key->key, FALSE, priv->screens);
+ if (key->key)
+ grab_key_unsafe (key->key, FALSE, priv->screens);
+ }
+ g_ptr_array_free (priv->keys, TRUE);
+ priv->keys = NULL;
}
- g_ptr_array_free (priv->keys, TRUE);
- priv->keys = NULL;
gdk_flush ();
gdk_error_trap_pop_ignored ();
--
1.7.8.4

View File

@ -1,6 +1,6 @@
Name: gnome-settings-daemon
Version: 3.3.4
Release: 1%{?dist}
Release: 2%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
Group: System Environment/Daemons
@ -12,6 +12,12 @@ Source: http://download.gnome.org/sources/%{name}/3.3/%{name}-%{version}
# Fedora specific patch
Patch0: gsd-calculator.patch
# upstream fixes
Patch1: 0001-Updates-Don-t-call-g_object_unref-on-a-GPtrArray.patch
Patch2: 0001-media-keys-Be-more-careful-when-finalizing.patch
Patch3: 0001-XSettings-be-more-careful-when-shutting-down.patch
Patch4: 0001-Media-keys-Even-more-careful-when-finalizing.patch
Requires: control-center-filesystem
BuildRequires: dbus-glib-devel
@ -58,6 +64,10 @@ developing applications that use %{name}.
%prep
%setup -q
%patch0 -p1 -b .calc
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
autoreconf -i -f
@ -204,6 +214,9 @@ glib-compile-schemas %{_datadir}/glib-2.0/schemas &> /dev/null || :
%{_datadir}/gnome-settings-daemon-3.0/input-device-example.sh
%changelog
* Fri Jan 20 2012 Matthias Clasen <mclasen@redhat.com> 3.3.4-2
- Some crash fixes
* Tue Jan 17 2012 Bastien Nocera <bnocera@redhat.com> 3.3.4-1
- Update to 3.3.4