From 69702475e5ae3fda1a4c4a854100ebb4f65e338b Mon Sep 17 00:00:00 2001 From: Weng Xuetian Date: Thu, 14 Apr 2022 21:40:51 -0700 Subject: [PATCH] Fix not working applet with same compact/full representation when hiding If preferred, compact and full represenation are set to the same value, the value of appletShouldBeExpanded will be true, which means the applet will be expanded by default. In this case, only fullRepresentation will be created and compactRepresentationItem will simply be null. If compactRepresentationItem is null, also check the fullRepresentation for mouse event forwarding. This fixes manage-inputmethod applet not working if it's hidden in the tray. --- .../systemtray/package/contents/ui/items/PlasmoidItem.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml b/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml index 1f5091595..e56cfdb65 100644 --- a/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml +++ b/applets/systemtray/package/contents/ui/items/PlasmoidItem.qml @@ -38,7 +38,8 @@ AbstractItem { return } //forward click event to the applet - const mouseArea = findMouseArea(applet.compactRepresentationItem) + var appletItem = applet.compactRepresentationItem ? applet.compactRepresentationItem : applet.fullRepresentationItem + const mouseArea = findMouseArea(appletItem) if (mouseArea) { mouseArea.clicked(mouse) } else if (mouse.button === Qt.LeftButton) {//falback @@ -61,7 +62,8 @@ AbstractItem { return } //forward wheel event to the applet - const mouseArea = findMouseArea(applet.compactRepresentationItem) + var appletItem = applet.compactRepresentationItem ? applet.compactRepresentationItem : applet.fullRepresentationItem + const mouseArea = findMouseArea(appletItem) if (mouseArea) { mouseArea.wheel(wheel) }