From 1ce09dcfcb78198c95a94bf4d6f75a49c2b77dc0 Mon Sep 17 00:00:00 2001 From: Konrad Materka Date: Fri, 21 May 2021 23:54:54 +0200 Subject: [PATCH] [applets/systemtray] Fix highlight on applet pin Sometimes parent component on the applet is not fully updated - for example effectiveStatus is not yet read from the model. In such case it will have default value leading to undesired effect. Call all `updateHighlightedItem` in `Qt.callLater` so that it is called in next event loop. As a bonus it is called only once, which can improve performance. BUG: 437105 FIXED-IN: 5.22.0 (cherry picked from commit 07b3b10de7d09b8918bd237cf0eca9d3fe868c64) --- .../package/contents/ui/CurrentItemHighLight.qml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml b/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml index 18fe20a49..99892fcca 100644 --- a/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml +++ b/applets/systemtray/package/contents/ui/CurrentItemHighLight.qml @@ -59,11 +59,11 @@ PlasmaCore.FrameSvgItem { target: systemTrayState function onActiveAppletChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } function onExpandedChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } } @@ -72,7 +72,7 @@ PlasmaCore.FrameSvgItem { target: systemTrayState.activeApplet function onParentChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } } @@ -81,11 +81,11 @@ PlasmaCore.FrameSvgItem { target: parent function onWidthChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } function onHeightChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } } @@ -94,7 +94,7 @@ PlasmaCore.FrameSvgItem { target: !!highlightedItem && highlightedItem.parent ? highlightedItem.parent : null function onScaleChanged() { - updateHighlightedItem(); + Qt.callLater(updateHighlightedItem); } }