From 29b1cfbaada3aeacdfdc16affba901081b625c8e Mon Sep 17 00:00:00 2001 From: Kim Woelders Date: Sat, 6 Apr 2024 13:07:40 +0200 Subject: [PATCH] session: Try dbus before SM/ICE on logout/shutdown Otherwise we will not get the Shutdown/Reboot dialog but always the Logout one (with dbus and SM both enabled). --- src/session.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/src/session.c b/src/session.c index 7a379b9b..a4a96fd2 100644 --- a/src/session.c +++ b/src/session.c @@ -564,25 +564,26 @@ _SessionExitDbus(int how) static void _SessionLogout(int how) { -#if USE_SM +#ifdef USE_SM if (EDebug(EDBUG_TYPE_SESSION)) Eprintf("%s: how=%d smc=%p\n", __func__, how, sm_conn); +#else + if (EDebug(EDBUG_TYPE_SESSION)) + Eprintf("%s: how=%d\n", __func__, how); +#endif +#if USE_DBUS + if (_SessionExitDbus(how) == 0) + return; +#endif + +#if USE_SM if (sm_conn) { SmcRequestSaveYourself(sm_conn, SmSaveBoth, True, SmInteractStyleAny, False, True); return; } -#else - if (EDebug(EDBUG_TYPE_SESSION)) - Eprintf("%s: how=%d\n", __func__, how); - -#endif /* USE_SM */ - -#if USE_DBUS - if (_SessionExitDbus(how) == 0) - return; #endif switch (how)