From ba260e72a19a7e53a2d8aa366349da459204eebb Mon Sep 17 00:00:00 2001 From: Roman Gilg Date: Tue, 4 Apr 2017 18:25:24 +0200 Subject: [PATCH] [System Tray] Fix regression on SNI fallback As mentioned in https://bugs.kde.org/show_bug.cgi?id=365308 because of 27b103075600 we regressed on 5d5518455d10. This patch fixes it again. Reviewers: #plasma, broulik, davidedmundson, mart Reviewed By: mart Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D5270 --- .../contents/ui/items/StatusNotifierItem.qml | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml index ac4823809..e646c7252 100644 --- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml +++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml @@ -73,22 +73,13 @@ AbstractItem { if (!job.result) { // On error try to invoke the context menu. // Workaround primarily for apps using libappindicator. - contextMenu(mouse); + openContextMenu(pos); } }); break; } case Qt.RightButton: - var service = statusNotifierSource.serviceForSource(DataEngineSource); - var operation = service.operationDescription("ContextMenu"); - operation.x = pos.x; - operation.y = pos.y; - - var job = service.startOperationCall(operation); - job.finished.connect(function () { - plasmoid.nativeInterface.showStatusNotifierContextMenu(job, taskIcon); - }); - + openContextMenu(pos); break; case Qt.MiddleButton: @@ -102,6 +93,18 @@ AbstractItem { } } + function openContextMenu(pos) { + var service = statusNotifierSource.serviceForSource(DataEngineSource); + var operation = service.operationDescription("ContextMenu"); + operation.x = pos.x; + operation.y = pos.y; + + var job = service.startOperationCall(operation); + job.finished.connect(function () { + plasmoid.nativeInterface.showStatusNotifierContextMenu(job, taskIcon); + }); + } + onWheel: { //don't send activateVertScroll with a delta of 0, some clients seem to break (kmix) if (wheel.angleDelta.y !== 0) {