Bug 394249

Summary: Logout screen countdown not cancelling on multi-monitor setups
Product: [Plasma] ksmserver Reporter: Mayeul C. <oss+kde+bugzilla>
Component: generalAssignee: Lubos Lunak <l.lunak>
Status: RESOLVED FIXED    
Severity: normal CC: plasma-bugs
Priority: NOR    
Version: 5.12.5   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Illustration: countdown is cancelled only on the left monitor

Description Mayeul C. 2018-05-14 11:40:28 UTC
Created attachment 112639 [details]
Illustration: countdown is cancelled only on the left monitor

This might be related to the look and feel package as well.

I would have tried to fix it myself, but I am not proficient enough with Qt/qml to easily pinpoint the problem.

On multi monitor setups, the logout overlay appears on every screen. There is one countdown per screen. Moving the selection with the keyboard arrow keys interrupt the countdown on one screen, but not the others, so the log out action ends up happening anyway.

It is supposed to cancel the action on every screen.

It would actually be nicer not to assume that a screen is the primary one, and show the exact same state on every screen, including selection and hover (even duplicating the mouse could be interesting). My primary monitor is the center one, but the selection is displayed on the leftmost one.

See the attached screenshot where only the leftmost screen has its countdown cancelled. (A bit of corruption is visible on the rightmost screen as well, I am using X, Qt 5.10.1, plasma 5.12.5)

Related files might be https://cgit.kde.org/plasma-workspace.git/tree/lookandfeel/contents/logout/Logout.qml and https://cgit.kde.org/plasma-workspace.git/tree/ksmserver/shutdowndlg.cpp
Comment 1 David Edmundson 2018-05-16 10:19:03 UTC
Git commit 38367efd5e9320b69f8771476d3c52921555a4e4 by David Edmundson.
Committed on 16/05/2018 at 10:18.
Pushed by davidedmundson into branch 'master'.

Fix Logout screen countdown not cancelling on multi-monitor setups

Summary:
The logout greeter theme has a timer that invokes the current action if
no keyboard interaction has taken place.

This cancel on keyboard nav is broken on multiple monitor setups as even
if a user is interacting with one, the timer from another can still
fire.

Fix is via JS singleton library as the timer is very theme specific. I
didn't want to add anything in shutdowndlg.cpp as it would be breaking
layering.

Test Plan:
Had multi monitor setup
Pressed key on one screen. All timer UIs cleared, nothing happened after
30 seconds

Reviewers: #plasma

Subscribers: zzag, broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D12893

M  +6    -0    lookandfeel/contents/logout/Logout.qml
M  +2    -1    lookandfeel/contents/logout/LogoutButton.qml
C  +16   -18   lookandfeel/contents/logout/timer.js [from: lookandfeel/contents/logout/LogoutButton.qml - 069% similarity]

https://commits.kde.org/plasma-workspace/38367efd5e9320b69f8771476d3c52921555a4e4