Bug 488277 - Unable to leave session when using custom window manager
Summary: Unable to leave session when using custom window manager
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (show other bugs)
Version: 6.0.5
Platform: Manjaro Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2024-06-09 22:53 UTC by nikht0
Modified: 2024-06-10 17:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nikht0 2024-06-09 22:53:13 UTC
SUMMARY
Hello,

I use i3 as window manager, and I can't log out using the splash screen, nor any standard way.

STEPS TO REPRODUCE
1.  Start plasma with `KDEWM` set (for my case, `i3`) 
2. Try to log out using any method (krunner, `qdbus6 org.kde.Shutdown /Shutdown  org.kde.Shutdown.logout`)
3. Fail

OBSERVED RESULT
Journal control gives: 
```
plasma-shutdown[75648]: org.kde.plasma.shutdown: KWin failed to complete logout
```
EXPECTED RESULT
Logout should be successful.

It seems that the bug stems from "23cca93  shutdown: Introduce support for KWin closing wayland windows" which
sends a DBus request to the non-existent service "org.kde.KWin". Creating a mock service returning true to `org.kde.KWin.Session.closeWaylandWindows`  fixes the bug.

This has been evoked by Bug 481938 Comment 77 

Cheers,
Comment 1 Dhruv Maroo 2024-06-10 07:39:13 UTC
Hi,

I can also confirm that I have been facing this issue. I have been using a mock KWin DBus service[1] for quite a while. Obviously, this is just a hacky fix and not a proper solution. This commit[2] introduced the call to `closeWaylandWindows` when shutting down. I believe adding a simple isValid()[3] check for the `OrgKdeKWinSessionInterface` before calling any DBus methods should fix the issue.

[1]: https://github.com/DMaroo/fakwin
[2]: https://github.com/KDE/plasma-workspace/commit/23cca93b879d0fcf9f430b03a482dbca1e0a1d79
[3]: https://doc.qt.io/qt-6/qdbusabstractinterface.html#isValid