Bug 359683

Summary: Clients can change the VD (and activate) via _NET_ACTIVE_WINDOW messages
Product: [Plasma] kwin Reporter: Thomas Lübking <thomas.luebking>
Component: coreAssignee: Thomas Lübking <thomas.luebking>
Status: RESOLVED FIXED    
Severity: normal CC: jkt
Priority: NOR Flags: thomas.luebking: ReviewRequest+
Version First Reported In: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
URL: https://git.reviewboard.kde.org/r/127153/
Latest Commit: Version Fixed/Implemented In: 5.6
Sentry Crash Report:
Attachments: proof of issue

Description Thomas Lübking 2016-02-22 21:57:26 UTC
Cause is 

commit 60e904fb0447127a6bc0aa3309e2b98109110dec
Author: Luboš Luňák <l.lunak@kde.org>
Date:   Thu Nov 29 15:01:30 2007 +0000

    Don't refuse explicit window activation request just because the window
    is not on the current desktop.

----------

QDialog or at least QMessageBox does this and I doubt Lubos' idea was to "allow focus stealing if the client nags enough" - switching the VD is a major interrupt and prevented when a new window shows up. It should not be possible to stomp on ground and then receive focus - notably not on the other desktop.

I assume the original idea was to let clients distribute focus *inside* across virtual desktops, maybe also permit when no client was active, but hardly otherwise.

Reproducible: Always
Comment 1 Thomas Lübking 2016-02-22 21:59:00 UTC
Created attachment 97364 [details]
proof of issue
Comment 2 Thomas Lübking 2016-02-27 10:28:04 UTC
Git commit 0e80a16db57cb194431725aa204e1fa871ea87c6 by Thomas Lübking.
Committed on 27/02/2016 at 10:26.
Pushed by luebking into branch 'master'.

restrict cross-vd activation to in-client distrib

QDialog or at least QMessageBox does this and I doubt Lubos' idea was to
"allow focus stealing if the client nags enough" - switching the VD is a
major interrupt and prevented when a new window shows up.
It should not be possible to stomp on ground and then receive
focus - notably not on the other desktop.

I assume the original idea was to let clients distribute focus *inside*
across virtual desktops, maybe also permit when no client was active,
but hardly otherwise.
FIXED-IN: 5.6
REVIEW: 127153

M  +3    -0    activation.cpp

http://commits.kde.org/kwin/0e80a16db57cb194431725aa204e1fa871ea87c6