File: upstream_f17c2546_applets-systemtray-Open-context-menu-on-click-when-ItemIsMenu.patch

package info (click to toggle)
plasma-workspace 4%3A6.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 104,900 kB
  • sloc: cpp: 125,434; xml: 31,579; python: 3,976; perl: 572; sh: 234; javascript: 74; ruby: 39; ansic: 13; makefile: 9
file content (33 lines) | stat: -rw-r--r-- 1,187 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From f17c2546f6c67e5636a4ccab2519ea50c2ed2bce Mon Sep 17 00:00:00 2001
From: Kai Uwe Broulik <kde@privat.broulik.de>
Date: Sat, 22 Mar 2025 18:22:35 +0100
Subject: [PATCH] applets/systemtray: Open context menu on click when
 ItemIsMenu

As per StatusNotifierItem spec:

> The item only support the context menu, the visualization should
prefer showing the menu or sending ContextMenu() instead of Activate()
---
 .../package/contents/ui/items/StatusNotifierItem.qml         | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
index bd153d97731..6b683077a1b 100644
--- a/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
+++ b/applets/systemtray/package/contents/ui/items/StatusNotifierItem.qml
@@ -42,6 +42,11 @@ AbstractItem {
     }
 
     onActivated: pos => {
+        if (model.ItemIsMenu) {
+            openContextMenu(pos);
+            return;
+        }
+
         const service = model.Service;
         const operation = service.operationDescription("Activate");
         operation.x = pos.x; //mouseX
-- 
GitLab