From 27b1030756002e91b60ba51483efe9c2c477d16e Mon Sep 17 00:00:00 2001 From: Kai Uwe Broulik Date: Wed, 8 Feb 2017 11:02:33 +0100 Subject: [PATCH] [System Tray] Part Revert "Trigger context menu on press" as this breaks xembedsniproxy This part reverts commit b9af99140365c8c8cf4e3744af7e13b35c35fa18 which changes plasmoids and SNI items to activate on mouse release instead of mouse click. This messes with xembedsniproxy which is relaying the mouse press signals to the exembed client. Now at the time of relay, if the client application queries the mouse state itself it's going to be wrong and that breaks GTK. BUG: 375930 FIXED-IN: 5.9.2 Reviewed-By: David Edmundson --- .../contents/ui/items/AbstractItem.qml | 6 +---- .../contents/ui/items/StatusNotifierItem.qml | 27 +++++++++---------- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/applets/systemtray/package/contents/ui/items/AbstractItem.qml b/applets/systemtray/package/contents/ui/items/AbstractItem.qml index 34d0891a4..d06faceee 100644 --- a/applets/systemtray/package/contents/ui/items/AbstractItem.qml +++ b/applets/systemtray/package/contents/ui/items/AbstractItem.qml @@ -99,11 +99,7 @@ PlasmaCore.ToolTipArea { hoverEnabled: true drag.filterChildren: true acceptedButtons: Qt.LeftButton | Qt.MiddleButton | Qt.RightButton - onClicked: { - if (mouse.button !== Qt.RightButton) { - abstractItem.clicked(mouse) - } - } + onClicked: abstractItem.clicked(mouse) onPressed: { abstractItem.hideToolTip() if (mouse.button === Qt.RightButton) { diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml index b19dc53a9..4913835cf 100644 --- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml +++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml @@ -71,6 +71,19 @@ AbstractItem { service.startOperationCall(operation); 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); + }); + + break; + case Qt.MiddleButton: var service = statusNotifierSource.serviceForSource(DataEngineSource); var operation = service.operationDescription("SecondaryActivate"); @@ -82,20 +95,6 @@ AbstractItem { } } - onContextMenu: { - var pos = plasmoid.nativeInterface.popupPosition(taskIcon, 0, 0); - - 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) {