SUMMARY Both gnome-text-editor (GTK4) and gedit (GTK3) will inhibit sleep when run under KDE. Both use straightforward GTK apis to inhibit logout when there are unsaved documents. But in KDE, the "battery and brightness" widget will show them as inhibiting sleep, and the machine will indeed not go to sleep automatically. Sleep is not inhibited under GNOME Wayland or Plasma X11, just Plasma Wayland. (Logout is also not successfully inhibited, as documented in https://bugs.kde.org/show_bug.cgi?id=461176). Given that this issue is specific to KDE under Wayland, I am filing it with KDE instead of GTK I think the actual bug is more likely to be here. STEPS TO REPRODUCE In a KDE wayland session, open gedit, gnome-text-editor, or any other GTK app that inhibits logout. Observe that sleep is inhibited in the "Battery and Brightness" taskbar widget and the computer does not go to sleep automatically. SOFTWARE/OS VERSIONS Operating System: Debian GNU/Linux 12 KDE Plasma Version: 5.27.11 KDE Frameworks Version: 5.115.0 Qt Version: 5.15.13 Kernel Version: 6.11.4-amd64 (64-bit) Graphics Platform: offscreen Processors: 16 × AMD Ryzen 9 5900HX with Radeon Graphics Memory: 30.8 GiB of RAM Graphics Processor: AMD Radeon Graphics
Incorrect sleep inhibition through XDG desktop portals was fixed in Plasma 6.1.4 in this change: https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/305. I'm changing the bug report title to reflect this. At this time (6.2.3), Plasma's implementation of XDG desktop portals doesn't have support for "logout" type inhibitors. KDE apps can clearly do this, I wonder what it would take to implement this functionality in the portal.