SUMMARY Ever since upgrading to Plasma 6.1.1 my laptop will always sleep when closing the lid even when connected to an external monitor through HDMI. I have the settings in powerdevil such that lid closure should be ignored if connected to an external monitor. I tried changing the following settings in logind.conf (every possible combination) and rebooted. Nothing works. HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore HandleLidSwitchDocked=ignore LidSwitchIgnoreInhibited=yes and no STEPS TO REPRODUCE 1. connect external monitor 2. close lid OBSERVED RESULT computer sleeps EXPECTED RESULT computer stays awake SOFTWARE/OS VERSIONS Linux/KDE Plasma: Fedora 40 KDE Plasma Version: 6.1.1 KDE Frameworks Version: 6.3.0 Qt Version: 6.7.2 Wayland
(In reply to Eric from comment #0) > SUMMARY > > Ever since upgrading to Plasma 6.1.1 my laptop will always sleep when > closing the lid even when connected to an external monitor through HDMI. I > have the settings in powerdevil such that lid closure should be ignored if > connected to an external monitor. > > I tried changing the following settings in logind.conf (every possible > combination) and rebooted. Nothing works. > > HandleLidSwitch=ignore > HandleLidSwitchExternalPower=ignore > HandleLidSwitchDocked=ignore > LidSwitchIgnoreInhibited=yes and no > > STEPS TO REPRODUCE > 1. connect external monitor > 2. close lid > > OBSERVED RESULT > computer sleeps > > EXPECTED RESULT > computer stays awake > > SOFTWARE/OS VERSIONS > Linux/KDE Plasma: Fedora 40 > KDE Plasma Version: 6.1.1 > KDE Frameworks Version: 6.3.0 > Qt Version: 6.7.2 > Wayland Granted all the software versions remain same, this is also reproducible on Plasma version 6.1.2 on my end
PowerDevil ignores logind settings, its own settings (i.e. power state behavior configured in System Settings / Power Management) replace logind behavior. I can't confirm the bug though. The laptop lid settings in System Settings for my "On Battery" profile are set to "Sleep", and the checkbox "Even when an external monitor is connected" is unchecked. With this configuration, when I close the laptop, the laptop keeps running and the external monitor becomes the only screen. Only when I check the checkbox and apply, then the laptop actually goes to sleep. The "HandleButtonEvents" action that governs this behavior wouldn't be affected by all the recent display refactoring changes, because it never relied on PowerDevil's internal DDC/CI monitor recognition to begin with. It gets its data from KWin, which gets the set of connected displays directly from the kernel. Although I wonder if the "output type" from KWin is perhaps KScreen::Output::Unknown so the monitor gets ignored for determining this behavior?
Actually I found the solution a couple of days ago on another forum. Somehow on upgrading to KDE 6.1 I think a kwinoutputconfig.json setting gets corrupted. It's some setting in .config/kwinoutputconfig.json, but I don't know which one. Creating a new user and closing the lid works, so I tried just copying over the new user kwinoutputconfig.json file to my directory, but this file gets overwritten somehow after you edit it or on logout or something. So I copied the file over again from the new user and set it read only. Now everything works again. Oh, and I also have in my logind.conf file: HandleLidSwitch=ignore But I don't know that this has any effect.