@@ -69,10 +69,10 @@ MouseArea {
6969 Component.onCompleted: {
7070 var windowGeometry = windowStateStorage.getGeometry(root.windowId, Qt.rect(target.x, target.y, target.width, target.height))
7171 if (windowGeometry !== undefined) {
72− target.x = windowGeometry.x
73− target.y = windowGeometry.y
74− target.width = windowGeometry.width
75− target.height = windowGeometry.height
72+ target.width = Math.min(windowGeometry.width, root.screenWidth)
73+ target.height = Math.min(windowGeometry.height, root.screenHeight - PanelState.panelHeight)
74+ target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.width), 0)
75+ target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.height), PanelState.panelHeight)
7676 }
7777 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
7878 if (windowState === WindowStateStorage.WindowStateMaximized) {