From c4472ca39afa3ecae00f490096b20a680d7c731f Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Thu, 8 Dec 2022 21:24:33 -0500 Subject: [PATCH] Revert "taskswitcher: Improve performance of task preview loading" This reverts commit 1ae83644c8b60b2850233d3a7edd1831ea3257d1. --- components/mobileshell/qml/taskswitcher/Task.qml | 5 ++++- components/mobileshell/qml/taskswitcher/Thumbnail.qml | 7 +++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/components/mobileshell/qml/taskswitcher/Task.qml b/components/mobileshell/qml/taskswitcher/Task.qml index c0ac84d9..83c63485 100644 --- a/components/mobileshell/qml/taskswitcher/Task.qml +++ b/components/mobileshell/qml/taskswitcher/Task.qml @@ -227,10 +227,13 @@ Item { // attempt to load window preview Loader { id: pipeWireLoader - active: MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled + active: (taskSwitcher.visible || taskSwitcher.tasksModel.taskReorderingEnabled) && MobileShell.MobileShellSettings.taskSwitcherPreviewsEnabled anchors.fill: parent source: Qt.resolvedUrl("./Thumbnail.qml") + asynchronous: true + + onLoaded: this.item.refresh() } // darken effect diff --git a/components/mobileshell/qml/taskswitcher/Thumbnail.qml b/components/mobileshell/qml/taskswitcher/Thumbnail.qml index c47faf27..8fda0883 100644 --- a/components/mobileshell/qml/taskswitcher/Thumbnail.qml +++ b/components/mobileshell/qml/taskswitcher/Thumbnail.qml @@ -13,14 +13,13 @@ import org.kde.taskmanager 0.1 as TaskManager PipeWire.PipeWireSourceItem { id: root - visible: (taskSwitcher.visible || taskSwitcher.tasksModel.taskReorderingEnabled) - opacity: (nodeId > 0) ? 1 : 0 + visible: nodeId > 0 nodeId: waylandItem.nodeId readonly property alias uuid: waylandItem.uuid - onVisibleChanged: { - if (model.WinIdList && visible) { + function refresh() { + if (model.WinIdList) { waylandItem.uuid = model.WinIdList[0]; } }