Skip to content

Commit

Permalink
Fix restart and shutdown (#172)
Browse files Browse the repository at this point in the history
* Revert "csm-manager.c: Unset WAYLAND_DISPLAY during shutdown in a wayland"

This reverts commit 128fe7f.

* Revert "csm-manager.c: Stop the user dbus-daemon at the end of the session."

This reverts commit 9961f98.
  • Loading branch information
leigh123linux authored Jul 19, 2024
1 parent ab50e44 commit a5d4be9
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions cinnamon-session/csm-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,71 +941,6 @@ _client_stop (const char *id,
return FALSE;
}

static void
maybe_restart_user_bus (CsmManager *manager)
{
CsmSystem *system;
g_autoptr(GVariant) reply = NULL;
g_autoptr(GError) error = NULL;

if (manager->priv->dbus_disconnected)
return;

if (g_strcmp0 (g_getenv ("XDG_SESSION_TYPE"), "wayland") == 0) {
g_debug ("CsmManager: Unsetting environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY");

GVariantBuilder builder;
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
g_variant_builder_add (&builder, "s", "GNOME_SETUP_DISPLAY");
g_variant_builder_add (&builder, "s", "WAYLAND_DISPLAY");
g_variant_builder_add (&builder, "s", "DISPLAY");
g_variant_builder_add (&builder, "s", "XAUTHORITY");

reply = g_dbus_connection_call_sync (manager->priv->connection,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
"UnsetEnvironment",
g_variant_new ("(@as)",
g_variant_builder_end (&builder)),
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1, NULL, &error);

if (error != NULL) {
g_debug ("CsmManager: unsetting environment failed: %s", error->message);
g_clear_error (&error);
}
else {
g_variant_unref (reply);
}
}

system = csm_get_system ();

if (!csm_system_is_last_session_for_user (system))
return;

g_debug ("CsmManager: reloading user bus");

reply = g_dbus_connection_call_sync (manager->priv->connection,
"org.freedesktop.systemd1",
"/org/freedesktop/systemd1",
"org.freedesktop.systemd1.Manager",
"StopUnit",
g_variant_new ("(ss)", "dbus.service", "fail"),
NULL,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);

if (error != NULL) {
g_debug ("CsmManager: reloading user bus failed: %s", error->message);
g_clear_error (&error);
}
}

static void
do_phase_exit (CsmManager *manager)
{
Expand All @@ -1014,7 +949,6 @@ do_phase_exit (CsmManager *manager)
(CsmStoreFunc)_client_stop,
NULL);
}
maybe_restart_user_bus (manager);
end_phase (manager);
}

Expand Down

0 comments on commit a5d4be9

Please sign in to comment.