From 8ac49010685b5b9883db53142be55ea08a0abae3 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Mon, 19 Sep 2022 11:56:47 +0300 Subject: [PATCH] effects/windowview: Turn placeholder on when there are actually no visible windows This may happen when all windows are minimized, and the effect was started in "Window class on current desktop" mode (Ctrl+F7). BUG: 459244 FIXED-IN: 5.26 --- src/effects/private/qml/WindowHeap.qml | 10 ++++++++++ src/effects/windowview/qml/main.qml | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/effects/private/qml/WindowHeap.qml b/src/effects/private/qml/WindowHeap.qml index 242776e67f..aa0436df05 100644 --- a/src/effects/private/qml/WindowHeap.qml +++ b/src/effects/private/qml/WindowHeap.qml @@ -26,6 +26,16 @@ FocusScope { property alias model: windowsRepeater.model property alias delegate: windowsRepeater.delegate readonly property alias count: windowsRepeater.count + readonly property bool activeEmpty: { + var children = expoLayout.visibleChildren; + for (var i = 0; i < children.length; i++) { + var child = children[i]; + if (child instanceof WindowHeapDelegate && !child.activeHidden) { + return false; + } + } + return true; + } property alias layout: expoLayout property int selectedIndex: -1 diff --git a/src/effects/windowview/qml/main.qml b/src/effects/windowview/qml/main.qml index 66e22c49bf..87a44e884c 100644 --- a/src/effects/windowview/qml/main.qml +++ b/src/effects/windowview/qml/main.qml @@ -1,5 +1,6 @@ /* SPDX-FileCopyrightText: 2021 Vlad Zahorodnii + SPDX-FileCopyrightText: 2022 ivan tkachenko SPDX-License-Identifier: GPL-2.0-or-later */ @@ -92,7 +93,7 @@ Item { PlasmaExtras.PlaceholderMessage { anchors.centerIn: parent width: parent.width - (PlasmaCore.Units.gridUnit * 8) - visible: heap.count === 0 + visible: heap.activeEmpty iconName: "edit-none" text: effect.searchText.length > 0 ? i18nd("kwin_effects", "No Matches") : i18nd("kwin_effects", "No Windows") }