Bug 465566 - Password entry field one one screen has focus stolen when a different slow screen turns on
Summary: Password entry field one one screen has focus stolen when a different slow sc...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Screen locking (show other bugs)
Version: 6.2.4
Platform: Arch Linux Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: usability
Depends on:
Blocks:
 
Reported: 2023-02-10 23:59 UTC by Nicolas F.
Modified: 2025-03-25 16:30 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas F. 2023-02-10 23:59:48 UTC
SUMMARY

In a multi-monitor setup, if one monitor takes longer to wake up than the other, kscreenlocker switches the focus from the password entry field to the new monitor during typing. This prevents me from inputting my password immediately after the primary monitor wakes up.


STEPS TO REPRODUCE
1. Get two monitors, one of which wakes from sleep slower than the other
2. Wait for them to lock and fall asleep
3. Shake the mouse or whatever else to begin the wakeup, start typing in the password field

OBSERVED RESULT

Input focus switches to the secondary slower monitor as soon as it wakes up.

EXPECTED RESULT

Focus remains on the password field on the primary monitor that I'm typing into.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Linux 6.1.10
(available in About System)
KDE Plasma Version: 5.26.5
KDE Frameworks Version: 5.102.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION

An alternative solution would be an option to restrict the password entry for the lock screen to a specific monitor, so that the secondary monitor does not interfere.
Comment 1 Nate Graham 2023-02-12 17:54:08 UTC
> An alternative solution would be an option to restrict the password entry for the lock screen
> to a specific monitor, so that the secondary monitor does not interfere.
Yep, see Bug 409226.
Comment 2 fanzhuyifan 2025-01-24 03:21:23 UTC
The current code is supposed to always put focus on the screen with cursor, but an upstream bug in Qt is preventing this.

https://bugreports.qt.io/browse/QTBUG-133204
Comment 3 fanzhuyifan 2025-02-05 17:09:50 UTC
I think there might be some additional Qt bug here -- QCursor::pos is not correctly updated after the screen configuration changes.
Comment 4 fanzhuyifan 2025-03-25 16:30:50 UTC
Git commit 305d88e050ffe4018544e6d4b7c5c6730ca5c0d4 by Yifan Zhu.
Committed on 25/03/2025 at 16:03.
Pushed by fanzhuyifan into branch 'master'.

lockscreen: only show UI on screen with mouse

Otherwise one appears on every screen, which is awkward. However, forcing it
to be on a particular screen is undesirable, since if that screen is turned off
but not unplugged, it may still be sending a signal to the OS and show up as a
valid screen to show things on.

To alleviate that concern, always show the UI on the screen with
pointer.

Test plan:
- use multiscreen setup and lock screen
- move mouse across screens, verify that only screen with pointer shows controls
- type some password without pressing enter, and repeat previous point
Related: bug 409226

M  +4    -1    desktoppackage/contents/lockscreen/LockScreenUi.qml

https://invent.kde.org/plasma/plasma-desktop/-/commit/305d88e050ffe4018544e6d4b7c5c6730ca5c0d4