Fix #361 - Panel is off-positioned after monitor wake up.

This commit is contained in:
ItsLemmy
2025-10-02 17:41:47 -04:00
parent 40410b603f
commit 171661d8b8
+12 -3
View File
@@ -87,9 +87,18 @@ Loader {
// Get the button position if provided
if (buttonItem !== undefined && buttonItem !== null) {
useButtonPosition = true
var itemPos = buttonItem.mapToItem(null, 0, 0)
buttonPosition = Qt.point(itemPos.x, itemPos.y)
// Try to get the button's window
var buttonWindow = buttonItem.Window.window
if (buttonWindow) {
// Map to button's window coordinates
var itemPosInWindow = buttonItem.mapToItem(buttonWindow.contentItem, 0, 0)
// Then account for window position on screen
buttonPosition = Qt.point(buttonWindow.x + itemPosInWindow.x, buttonWindow.y + itemPosInWindow.y)
} else {
// Fallback to old method
var itemPos = buttonItem.mapToItem(null, 0, 0)
buttonPosition = Qt.point(itemPos.x, itemPos.y)
}
buttonWidth = buttonItem.width
buttonHeight = buttonItem.height
} else {