From e5c1705e3fe6278a9b321379d7f24ec839c8d09f Mon Sep 17 00:00:00 2001 From: nico Date: Tue, 28 Jul 2026 22:43:24 +0200 Subject: [PATCH] Fix tray context menus (Quit etc.) not appearing QApplication mode is required for native PlatformMenuEntry popups; also fix right-click coordinates being passed relative to the tray icon instead of the bar window. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94 --- quickshell/default/Bar.qml | 4 +++- quickshell/default/shell.qml | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/quickshell/default/Bar.qml b/quickshell/default/Bar.qml index 354bb79..2c4e931 100644 --- a/quickshell/default/Bar.qml +++ b/quickshell/default/Bar.qml @@ -375,11 +375,13 @@ Variants { } MouseArea { + id: trayItemArea anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton onClicked: mouse => { if (mouse.button === Qt.RightButton && modelData.hasMenu) { - modelData.display(bar, mouse.x, mouse.y) + var pos = trayItemArea.mapToItem(bar.contentItem, mouse.x, mouse.y) + modelData.display(bar, pos.x, pos.y) } else { modelData.activate() } diff --git a/quickshell/default/shell.qml b/quickshell/default/shell.qml index c1f86ef..a19d6c8 100644 --- a/quickshell/default/shell.qml +++ b/quickshell/default/shell.qml @@ -1,3 +1,4 @@ +//@ pragma UseQApplication import QtQuick import Quickshell