Changeset View
Changeset View
Standalone View
Standalone View
applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
Show First 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 62 | onClicked: { | |||
---|---|---|---|---|---|
63 | var pos = plasmoid.nativeInterface.popupPosition(taskIcon, 0, 0); | 63 | var pos = plasmoid.nativeInterface.popupPosition(taskIcon, 0, 0); | ||
64 | 64 | | |||
65 | switch (mouse.button) { | 65 | switch (mouse.button) { | ||
66 | case Qt.LeftButton: { | 66 | case Qt.LeftButton: { | ||
67 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 67 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | ||
68 | var operation = service.operationDescription("Activate"); | 68 | var operation = service.operationDescription("Activate"); | ||
69 | operation.x = pos.x; | 69 | operation.x = pos.x; | ||
70 | operation.y = pos.y; | 70 | operation.y = pos.y; | ||
71 | service.startOperationCall(operation); | 71 | var job = service.startOperationCall(operation); | ||
72 | job.finished.connect(function () { | ||||
73 | if (!job.result) { | ||||
74 | // On error try to invoke the context menu. | ||||
75 | // Workaround primarily for apps using libappindicator. | ||||
76 | contextMenu(mouse); | ||||
77 | } | ||||
78 | }); | ||||
72 | break; | 79 | break; | ||
73 | } | 80 | } | ||
74 | case Qt.MiddleButton: | 81 | case Qt.MiddleButton: | ||
75 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | 82 | var service = statusNotifierSource.serviceForSource(DataEngineSource); | ||
76 | var operation = service.operationDescription("SecondaryActivate"); | 83 | var operation = service.operationDescription("SecondaryActivate"); | ||
77 | operation.x = pos.x; | 84 | operation.x = pos.x; | ||
78 | 85 | | |||
79 | operation.y = pos.y; | 86 | operation.y = pos.y; | ||
Show All 37 Lines |