Commit be784ba5 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

effects/windowview: Fix "active class" mode

Each screen has its own WindowHeap. So setting WindowHeap.activeClass
won't be visible on other screens.

In order to address that limitation, we could monitor
Workspace.activeClient property.

BUG: 455974
parent bc964ffd
Pipeline #232133 passed with stage
in 13 minutes and 2 seconds
......@@ -35,7 +35,6 @@ FocusScope {
property real padding: 0
// Either a string "activeClass" or a list internalIds of clients
property var showOnly: []
property string activeClass
required property bool organized
readonly property bool effectiveOrganized: expoLayout.ready && organized
......
......@@ -27,8 +27,12 @@ Item {
readonly property bool initialHidden: client.minimized || !presentOnCurrentDesktop
readonly property bool activeHidden: {
if (windowHeap.showOnly === "activeClass") {
// client.resourceName is not an actual String as comes from a QByteArray so === would fail
return windowHeap.activeClass !== String(client.resourceName);
if (!KWinComponents.Workspace.activeClient) {
return true;
} else {
// client.resourceName is not an actual String as comes from a QByteArray so === would fail
return String(KWinComponents.Workspace.activeClient.resourceName) !== String(client.resourceName);
}
} else {
return windowHeap.showOnly.length !== 0
&& windowHeap.showOnly.indexOf(client.internalId) === -1;
......@@ -52,20 +56,6 @@ Item {
readonly property alias downGestureProgress: touchDragHandler.downGestureProgress
signal downGestureTriggered()
Component.onCompleted: {
if (client.active) {
windowHeap.activeClass = client.resourceName;
}
}
Connections {
target: thumb.client
function onActiveChanged() {
if (thumb.client.active) {
thumb.windowHeap.activeClass = thumb.client.resourceName;
}
}
}
state: {
if (effect.gestureInProgress) {
return "partial";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment