[gnome-packagekit: 1/2] Add back logout support




commit 9822f7fb20ce49d5071fb3ef835a56d585732dcb
Author: Jonathan Kang <jonathankang gnome org>
Date:   Wed Jan 6 11:04:15 2021 +0800

    Add back logout support
    
    Logout support was dropped in commit 52b1ece4, as D-Bus interface
    implementation was moved to gnome-software in commit 83c6f859.
    
    Add it back.

 src/gpk-update-viewer.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/src/gpk-update-viewer.c b/src/gpk-update-viewer.c
index c9a8f29f..16031d94 100644
--- a/src/gpk-update-viewer.c
+++ b/src/gpk-update-viewer.c
@@ -255,6 +255,17 @@ gpk_update_viewer_check_restart (void)
                        gpk_update_viewer_error_dialog (_("Could not restart"), NULL, error->message);
                }
 #endif
+       } else if (restart_update == PK_RESTART_ENUM_SESSION) {
+               g_autoptr(GDBusConnection) bus = NULL;
+               bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
+               g_dbus_connection_call (bus,
+                                       "org.gnome.SessionManager",
+                                       "/org/gnome/SessionManager",
+                                       "org.gnome.SessionManager",
+                                       "Logout",
+                                       g_variant_new ("(u)", 0),
+                                       NULL, G_DBUS_CALL_FLAGS_NONE, G_MAXINT,
+                                       NULL, NULL, NULL);
        }
        return ret;
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]