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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//@ pragma UseQApplication
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
|
||||
Reference in New Issue
Block a user