diff --git a/quickshell/Components/SystemTray.qml b/quickshell/Components/SystemTray.qml index 3041f4f7..5f3c3f5e 100644 --- a/quickshell/Components/SystemTray.qml +++ b/quickshell/Components/SystemTray.qml @@ -36,7 +36,7 @@ RowLayout { hoverEnabled: true onClicked: function(mouseEvent) { - var m = delegateItem.QsWindow.mapFromItem(delegateItem, mouseEvent.x, mouseEvent.y); + var m = delegateItem.QsWindow.mapFromItem(delegateItem, delegateItem.width/2.0, delegateItem.height/2.0); var offset = popupLoader.item.width / 2.0; popupLoader.clicky = m.x - offset; if (openItemId == modelData.id) { diff --git a/quickshell/Components/SystemTrayWrapper.qml b/quickshell/Components/SystemTrayWrapper.qml index 9f7e8117..3fa6801b 100644 --- a/quickshell/Components/SystemTrayWrapper.qml +++ b/quickshell/Components/SystemTrayWrapper.qml @@ -20,7 +20,7 @@ Item { hoverEnabled: true onClicked: function(mouseEvent) { - var m = root.QsWindow.mapFromItem(ma, mouseEvent.x, mouseEvent.y); + var m = root.QsWindow.mapFromItem(ma, ma.width/2.0, ma.height/2.0); var offset = wrapperPopup.width / 2.0; wrapperPopup.clicky = m.x - offset; wrapperPopup.visible = !wrapperPopup.visible