File: upstream_305d88e0_lockscreen-only-show-UI-on-screen-with-mouse.patch

package info (click to toggle)
plasma-desktop 4%3A6.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 61,044 kB
  • sloc: cpp: 37,691; ansic: 2,617; python: 1,386; javascript: 1,163; xml: 1,082; sh: 128; makefile: 16
file content (50 lines) | stat: -rw-r--r-- 1,947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 305d88e050ffe4018544e6d4b7c5c6730ca5c0d4 Mon Sep 17 00:00:00 2001
From: Yifan Zhu <fanzhuyifan@gmail.com>
Date: Wed, 5 Feb 2025 08:16:54 -0800
Subject: [PATCH] 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

BUG: 409226
CCBUG: 465566
---
 desktoppackage/contents/lockscreen/LockScreenUi.qml | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/desktoppackage/contents/lockscreen/LockScreenUi.qml b/desktoppackage/contents/lockscreen/LockScreenUi.qml
index c96e2fde6e..6824e4e7cd 100644
--- a/desktoppackage/contents/lockscreen/LockScreenUi.qml
+++ b/desktoppackage/contents/lockscreen/LockScreenUi.qml
@@ -108,7 +108,7 @@ Item {
         id: lockScreenRoot
 
         property bool uiVisible: false
-        property bool blockUI: mainStack.depth > 1 || mainBlock.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive
+        property bool blockUI: containsMouse && (mainStack.depth > 1 || mainBlock.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive)
 
         x: parent.x
         y: parent.y
@@ -135,6 +135,9 @@ Item {
                 fadeoutTimer.restart();
             }
         }
+        onExited: {
+            uiVisible = false;
+        }
         Keys.onEscapePressed: {
             // If the escape key is pressed, kscreenlocker will turn off the screen.
             // We do not want to show the password prompt in this case.
-- 
GitLab