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).
This commit is contained in:
Kim Woelders 2024-04-06 13:07:40 +02:00
parent 355663252d
commit 29b1cfbaad
1 changed files with 11 additions and 10 deletions

View File

@ -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)