"When Laptop Lid Closed" options overrule a shutdown

I am currently running the KDE spin of Fedora 40, which uses KDE 6. I’m tremendously happy with KDE 6 so far, barring a few minor issues. However, there is one particular problem that has plagued me on a couple laptops I’ve used that had KDE 5.26, 5.27, and the most up-to-date version, also running Fedora, all of which used Wayland. I have not tested this on X11. I suspect it would appear on older versions of KDE, if I had used them.

Whenever I power off my laptop (by pressing “Shut Down” on the logout screen) but close the lid before the device has completely shut down, the device will fail to power off.
I believe this is in some way caused by my Energy Saving settings, as this only happens when the “When laptop lid closed” option is set to “Sleep” or “Lock Screen”. When set to “do nothing”, the device will shut down flawlessly.

Behavior changes somewhat depending on the “on laptop lid closed” setting chosen:

When the “Sleep” setting is active under “When laptop lid closed” and I initiate a shutdown, then close the lid before the shutdown completes, the device will not fully shut down. When I open the lid again, the screen will be black but still backlit, and the mouse will sometimes be visible and movable. My keyboard’s RGB will still be active (when in sleep mode, RGB and backlight will be off), indicating that the device is neither sleeping nor powered off. In one instance, my laptop’s fan started to turn on at full speed after staying in this state for a prolonged period of time.

When the “Lock Screen” setting is active under “When laptop lid closed”, and I perform the same process in the above paragraph, upon opening the laptop lid again, the device opens to the lock screen, which I can interact with, but it will continue shutting down once this screen is visible.

When the “Do nothing” setting is active under “When laptop lid closed” and I initiate a shutdown, regardless of whether or not I close the lid, the shutdown will complete successfully. I have not had the opportunity to test the “Shutdown” and “Turn off screen” options as of yet.

Due to the last three paragraphs, I believe that the laptop lid options in some way take priority over my device shutting down.

I tend to shut my lid as soon as I click the “Shut Down” option under the KDE Logout Screen. Is there a way to ensure that, even when “Sleep” is selected under “When laptop lid closed”, the device will shut off when “Shut Down” is run and the screen is closed before the shutoff finishes? Is there a way to set a delay for the “when laptop lid closed” action? Is this even intended behavior?
I’m a relatively new Linux and KDE convert, so any advice or suggestions would be greatly appreciated. Thank you in advance!

Edit:
System information of my current device with this issue, in case it’s relevant:
Operating System: Fedora Linux 40
KDE Plasma Version: 6.0.5
KDE Frameworks Version: 6.2.0
Qt Version: 6.7.0
Kernel Version: 6.8.10-300.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 7940HS w/ Radeon 780M Graphics
Memory: 58.7 GiB of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: Framework
Product Name: Laptop 16 (AMD Ryzen 7040 Series)
System Version: AJ

Having this exact same issue.

As a student, I often close my laptop when I leave my classes. I choose the “Shut down” option in logout menu and immediately close the lid, and instead of my laptop shutting down, the “When laptop lid closed” option set to “Sleep” takes priority.
Upon turning on my laptop, I’m thrown into a turned on black screen with nothing but a cursor and I have to shut it down using a power button.
I would prefer there being an option like “Closing lid takes priority over logout menu” or something similar.

1 Like

Glad I’m not the only one experiencing this, I was starting to believe it was something wrong with my device.

I can also confirm that this still occurs in Plasma 6.2.

It is also possible to choose Shutdown when closing the lid when you do want to shutdown after all and don’t like it when something else happens when you close the lid to fast.

Yes, you can set “On laptop lid closed” to “Shutdown,” but that’s not really a fix. Most of the time when I close the lid, I want the device to sleep.

I just don’t think it should be the case that the “on laptop lid closed” option should take precedent over the device actually shutting down. When the device is actively shutting down, it doesn’t make much sense for it to also attempt to sleep, or lock, or apply any other “on laptop lid closed” option to the screen. After all, Plasma 6.2 has already added options to prevent certain apps from impeding the shutdown process, so this would also make sense as a change/fix.

1 Like

I am having this issue so it apparently still persists. Has there been any movement on this or has anyone figured out a work around? This should probably be a bug report.

No movement on this. I haven’t yet submitted a bug report, as I haven’t had time to get around to it. If you’re able to though, feel free.

i also have the same issue with my Lenovo laptop, is there a bug report open?

Yes, there’s a bug report: 498593 – Laptop goes into (broken) standby, if lid is closed during shut down

2 Likes