Bug 504575 - Screen lock doesn't ignore power button presses
Summary: Screen lock doesn't ignore power button presses
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Screen locking (other bugs)
Version First Reported In: 6.3.90
Platform: Gentoo Packages Linux
: NOR minor
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-20 16:54 UTC by Martin Bednar
Modified: 2025-06-07 13:58 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Bednar 2025-05-20 16:54:50 UTC
Screen lock doesn't ignore power button presses, changes state of locked session

STEPS TO REPRODUCE
1. lock screen
2. Press power button
3. unlock screen

Session gets unlocked, shutdown selection screen is waiting instead of plain unlocked session.

Operating System: Gentoo 2.17
KDE Plasma Version: 6.3.90
KDE Frameworks Version: 6.14.0
Qt Version: 6.8.3
Kernel Version: 6.14.7-gentoo-dist-hardened (64-bit)
Graphics Platform: Wayland
Comment 1 Nate Graham 2025-05-20 17:27:58 UTC
Is there a particular reason you're pressing the power button? Do other keys to wake the screen not work?

Regardless, can't reproduce on my hardware, though it has a power button that you need to hold down for 2+ seconds to trigger it.
Comment 2 Martin Bednar 2025-05-20 17:39:02 UTC
(In reply to Nate Graham from comment #1)
> Is there a particular reason you're pressing the power button? 

not particularly: it's also the fingerprint reader, and sometimes my finger is a bit heavy :D

> 
> Regardless, can't reproduce on my hardware, though it has a power button
> that you need to hold down for 2+ seconds to trigger it.

This might be tied to power management setting "When power button pressed" -> "Show logout screen"
Comment 3 Martin Bednar 2025-05-20 17:48:43 UTC
> This might be tied to power management setting "When power button pressed"
> -> "Show logout screen"

Yes: can't reproduce without having this set in the profile I'm currently on.
Comment 4 Nate Graham 2025-05-20 18:36:55 UTC
Yeah, I've got that setting turned on too.
Comment 5 Martin Bednar 2025-05-20 18:39:32 UTC
Would you like a recording? It's really minor though...
Comment 6 Niccolò Venerandi 2025-05-30 08:22:24 UTC
Can reproduce.
Comment 7 Bug Janitor Service 2025-05-30 08:55:15 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/5543
Comment 8 Niccolò Venerandi 2025-06-02 11:34:54 UTC
Git commit ba7a8c16b7934fa23d3a44bb38667554e39996b7 by Niccolò Venerandi.
Committed on 02/06/2025 at 11:34.
Pushed by niccolove into branch 'master'.

Do not show logout screen when in lockscreen / screensaver

M  +12   -5    libkworkspace/sessionmanagement.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/ba7a8c16b7934fa23d3a44bb38667554e39996b7
Comment 9 Niccolò Venerandi 2025-06-02 11:35:07 UTC
Git commit f1605df4a461874f39e6aef217397caab4d91e47 by Niccolò Venerandi.
Committed on 02/06/2025 at 11:35.
Pushed by niccolove into branch 'Plasma/6.4'.

Do not show logout screen when in lockscreen / screensaver


(cherry picked from commit ba7a8c16b7934fa23d3a44bb38667554e39996b7)

Co-authored-by: Niccolò Venerandi <niccolo@venerandi.com>

M  +12   -5    libkworkspace/sessionmanagement.cpp

https://invent.kde.org/plasma/plasma-workspace/-/commit/f1605df4a461874f39e6aef217397caab4d91e47
Comment 10 Martin Bednar 2025-06-02 17:24:21 UTC
Thank you! You guys rock.
Comment 11 Roke Julian Lockhart Beedell 2025-06-07 12:59:52 UTC
To confirm, this shan't affect those who have “When power button pressed” → “Power off”? I ask because I need the POWER_SW to always work, for the few times that the OS becomes inaccessible (via HID)s, like https://gitlab.freedesktop.org/drm/amd/-/issues/3462#screenshotsvideo-files.
Comment 12 Martin Bednar 2025-06-07 13:58:11 UTC
(In reply to Roke Julian Lockhart Beedell from comment #11)
> To confirm, this shan't affect those who have “When power button pressed” →
> “Power off”? I ask because I need the POWER_SW to always work, for the few
> times that the OS becomes inaccessible (via HID)s, like
> https://gitlab.freedesktop.org/drm/amd/-/issues/3462#screenshotsvideo-files.

Looking at the code, the check only happens after the logout prompt has been requested. So my understanding is that it shouldn't. 
I just tried setting the power button action to suspend, and using plasma 6.3.91 (which AFAIK contains the change) it did suspend when pressed in the lock screen.