- Shutdown cleanly when bus goes away (bug 445898 again)

This commit is contained in:
Ray Strode 2008-12-10 20:00:33 +00:00
parent af800ed610
commit f0694a7ec1
2 changed files with 51 additions and 1 deletions

View File

@ -207,3 +207,50 @@ diff --git a/plugins/a11y-keyboard/gsd-a11y-keyboard-manager.c b/plugins/a11y-ke
if (p->slowkeys_alert != NULL) if (p->slowkeys_alert != NULL)
gtk_widget_destroy (p->slowkeys_alert); 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;

View File

@ -1,6 +1,6 @@
Name: gnome-settings-daemon Name: gnome-settings-daemon
Version: 2.25.2 Version: 2.25.2
Release: 7%{?dist} Release: 8%{?dist}
Summary: The daemon sharing settings from GNOME to GTK+/KDE applications Summary: The daemon sharing settings from GNOME to GTK+/KDE applications
Group: System Environment/Daemons Group: System Environment/Daemons
@ -179,6 +179,9 @@ fi
%{_libdir}/pkgconfig/gnome-settings-daemon.pc %{_libdir}/pkgconfig/gnome-settings-daemon.pc
%changelog %changelog
* Wed Dec 10 2008 Ray Strode <rstrode@redhat.com> - 2.25.2-8
- Shutdown cleanly when bus goes away (bug 445898 again)
* Wed Dec 10 2008 Ray Strode <rstrode@redhat.com> - 2.25.2-7 * Wed Dec 10 2008 Ray Strode <rstrode@redhat.com> - 2.25.2-7
- Don't map touch pad tap to right-click for left-handed - Don't map touch pad tap to right-click for left-handed
users (bug 324721) users (bug 324721)