From be784ba5d2370dd952896df0bc3fd13bd6348eee Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Wed, 14 Sep 2022 15:07:54 +0300 Subject: [PATCH] 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 --- src/effects/private/qml/WindowHeap.qml | 1 - .../private/qml/WindowHeapDelegate.qml | 22 +++++-------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/effects/private/qml/WindowHeap.qml b/src/effects/private/qml/WindowHeap.qml index bb471c8110..d95d3db790 100644 --- a/src/effects/private/qml/WindowHeap.qml +++ b/src/effects/private/qml/WindowHeap.qml @@ -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 diff --git a/src/effects/private/qml/WindowHeapDelegate.qml b/src/effects/private/qml/WindowHeapDelegate.qml index 0283c84a3c..d6e9f8dc79 100644 --- a/src/effects/private/qml/WindowHeapDelegate.qml +++ b/src/effects/private/qml/WindowHeapDelegate.qml @@ -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";