Bug 476533 - [kdesrc-build Plasma 6] Pressing Esc no longer turns off the screen when locked
Summary: [kdesrc-build Plasma 6] Pressing Esc no longer turns off the screen when locked
Status: RESOLVED FIXED
Alias: None
Product: kscreenlocker
Classification: Plasma
Component: general (show other bugs)
Version: git-master
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: qt6, regression
Depends on:
Blocks:
 
Reported: 2023-11-04 02:39 UTC by Prajna Sariputra
Modified: 2024-01-24 20:19 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Prajna Sariputra 2023-11-04 02:39:37 UTC
SUMMARY
With Plasma 6 set up using kdesrc-build and after getting around bug 476508 I found that pressing Esc does not turn off the screen when locked, and if the password field is on screen pressing Esc makes it act like I just pressed Enter, it says "Unlocking failed", shakes the password field and then hides said field.

This is different from bug 466344 in that I don't get the issue in the distro installed Plasma 5.27.9, and in that other bug pressing Esc doesn't attempt to unlock the system like in my case.


STEPS TO REPRODUCE
1. Install Plasma 6 via kdesrc-build
2. Login
3. Lock the screen
4. Press Esc

OBSERVED RESULT
The screen does not turn off.

EXPECTED RESULT
The screen turns off.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 5.27.80
KDE Frameworks Version: 5.240.0
Qt Version: 6.6.0
Kernel Version: 6.5.9-arch2-1 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 6800H with Radeon Graphics
Memory: 30.6 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION
kscreenlocker is at commit 6777145016231427cccb4721de1e469a1512715c when I compiled it.

Also, when I tried adding some QWarning calls at and around [1] and recompiling I see that the greeter did recognise that the Esc key was pressed, but it never gets to the `dpms->switchMode(KScreen::Dpms::Off)` call. I don't think it's an issue with DPMS not being supported since the the turn off screen keyboard shortcut works just fine, even when the screen is locked.

[1]: https://invent.kde.org/plasma/kscreenlocker/-/blob/6777145016231427cccb4721de1e469a1512715c/greeter/greeterapp.cpp#L619
Comment 1 Nate Graham 2023-11-06 14:41:08 UTC
Can reproduce. Fallout from the recent KScreenlocker authenticator changes.
Comment 2 Bharadwaj Raju 2023-11-07 17:41:18 UTC
If I just add an unconditional `dpms->switchMode(KScreen::Dpms::Off);` before the connect call, it seems to work.
Comment 3 Nate Graham 2023-11-09 21:39:18 UTC
Wanna submit it and see what happens?
Comment 4 Prajna Sariputra 2023-11-10 00:47:47 UTC
I filed https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/176 to get rid of the evidently broken connect call and just turn off the screen directly. No idea what would happen on a system without DPMS support though.
Comment 5 Nate Graham 2024-01-12 17:12:22 UTC
Bug 338796 got re-opened, so let's track it there since there's an open MR to fix it again.

*** This bug has been marked as a duplicate of bug 338796 ***
Comment 6 Jakob Petsovits 2024-01-23 22:27:07 UTC
Git commit 9aa3bd142370d8fa09f1c42b852ad54846f54260 by Jakob Petsovits, on behalf of Prajna Sariputra.
Committed on 23/01/2024 at 23:18.
Pushed by jpetso into branch 'master'.

greeter: Fix pressing Esc to turn off the display

The updated KScreen::Dpms documentation guarantees isSupported()
to work right after construction, so use it without async instead
of the supportedChanged signal which doesn't get emitted anymore
during initialization.

M  +3    -5    greeter/greeterapp.cpp

https://invent.kde.org/plasma/kscreenlocker/-/commit/9aa3bd142370d8fa09f1c42b852ad54846f54260
Comment 7 Jakob Petsovits 2024-01-24 20:19:30 UTC
Git commit 0b889fee8cf5080ea21fa5e90d32379b26d58de6 by Jakob Petsovits, on behalf of Prajna Sariputra.
Committed on 24/01/2024 at 21:16.
Pushed by jpetso into branch 'Plasma/6.0'.

greeter: Fix pressing Esc to turn off the display

The updated KScreen::Dpms documentation guarantees isSupported()
to work right after construction, so use it without async instead
of the supportedChanged signal which doesn't get emitted anymore
during initialization.


(cherry picked from commit 9aa3bd142370d8fa09f1c42b852ad54846f54260)

M  +3    -5    greeter/greeterapp.cpp

https://invent.kde.org/plasma/kscreenlocker/-/commit/0b889fee8cf5080ea21fa5e90d32379b26d58de6