From f0694a7ec10069ae95bf860fdcf895facf747a58 Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Wed, 10 Dec 2008 20:00:33 +0000 Subject: [PATCH] - Shutdown cleanly when bus goes away (bug 445898 again) --- ...tings-daemon-2.24.0-shutdown-cleanly.patch | 47 +++++++++++++++++++ gnome-settings-daemon.spec | 5 +- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/gnome-settings-daemon-2.24.0-shutdown-cleanly.patch b/gnome-settings-daemon-2.24.0-shutdown-cleanly.patch index d62967d..940ca5f 100644 --- a/gnome-settings-daemon-2.24.0-shutdown-cleanly.patch +++ b/gnome-settings-daemon-2.24.0-shutdown-cleanly.patch @@ -207,3 +207,50 @@ diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-ke if (p->slowkeys_alert != NULL) gtk_widget_destroy (p->slowkeys_alert); + +============================================================ + Shutdown properly when bus goes away + + Previously we were just letting libdbus +call exit(1) for us which bypasses the +clean up paths. + +diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c +--- a/gnome-settings-daemon/main.c ++++ b/gnome-settings-daemon/main.c +@@ -114,6 +114,21 @@ acquire_name_on_proxy (DBusGProxy *bus_proxy) + return ret; + } + ++static DBusHandlerResult ++bus_message_handler (DBusConnection *connection, ++ DBusMessage *message, ++ void *user_data) ++{ ++ if (dbus_message_is_signal (message, ++ DBUS_INTERFACE_LOCAL, ++ "Disconnected")) { ++ gtk_main_quit (); ++ return DBUS_HANDLER_RESULT_HANDLED; ++ } ++ ++ return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; ++} ++ + static DBusGConnection * + get_session_bus (void) + { +@@ -131,7 +146,12 @@ get_session_bus (void) + } + + connection = dbus_g_connection_get_connection (bus); +- dbus_connection_set_exit_on_disconnect (connection, TRUE); ++ dbus_connection_add_filter (connection, ++ (DBusHandleMessageFunction) ++ bus_message_handler, ++ NULL, NULL); ++ ++ dbus_connection_set_exit_on_disconnect (connection, FALSE); + + out: + return bus; diff --git a/gnome-settings-daemon.spec b/gnome-settings-daemon.spec index ca5ddad..1f64898 100644 --- a/gnome-settings-daemon.spec +++ b/gnome-settings-daemon.spec @@ -1,6 +1,6 @@ Name: gnome-settings-daemon Version: 2.25.2 -Release: 7%{?dist} +Release: 8%{?dist} Summary: The daemon sharing settings from GNOME to GTK+/KDE applications Group: System Environment/Daemons @@ -179,6 +179,9 @@ fi %{_libdir}/pkgconfig/gnome-settings-daemon.pc %changelog +* Wed Dec 10 2008 Ray Strode - 2.25.2-8 +- Shutdown cleanly when bus goes away (bug 445898 again) + * Wed Dec 10 2008 Ray Strode - 2.25.2-7 - Don't map touch pad tap to right-click for left-handed users (bug 324721)