diff --git a/interface/resources/qml/desktop/Desktop.qml b/interface/resources/qml/desktop/Desktop.qml index 417ca57125..c311a65730 100644 --- a/interface/resources/qml/desktop/Desktop.qml +++ b/interface/resources/qml/desktop/Desktop.qml @@ -21,6 +21,7 @@ FocusScope { objectName: "desktop" anchors.fill: parent + readonly int INVALID_POSITION: -9999; property rect recommendedRect: Qt.rect(0,0,0,0); property var expectedChildren; diff --git a/interface/resources/qml/windows-uit/Window.qml b/interface/resources/qml/windows-uit/Window.qml index db286ca44e..e549c3eef8 100644 --- a/interface/resources/qml/windows-uit/Window.qml +++ b/interface/resources/qml/windows-uit/Window.qml @@ -31,7 +31,7 @@ Fadable { // decorations can extend outside it. implicitHeight: content ? content.height : 0 implicitWidth: content ? content.width : 0 - x: -9999; y: -9999 + x: desktop.INVALID_POSITION; y: desktop.INVALID_POSITION; enabled: visible signal windowDestroyed(); @@ -275,7 +275,7 @@ Fadable { } function centerOrReposition() { - if (x == -9999 && y == -9999) { + if (x == desktop.INVALID_POSITION && y == desktop.INVALID_POSITION) { desktop.centerOnVisible(window); } else { desktop.repositionOnVisible(window); diff --git a/interface/resources/qml/windows/Window.qml b/interface/resources/qml/windows/Window.qml index 4d6b3a2f23..09621e622c 100644 --- a/interface/resources/qml/windows/Window.qml +++ b/interface/resources/qml/windows/Window.qml @@ -19,7 +19,7 @@ Fadable { // decorations can extend outside it. implicitHeight: content ? content.height : 0 implicitWidth: content ? content.width : 0 - x: -9999; y: -9999 + x: desktop.INVALID_POSITION; y: desktop.INVALID_POSITION; enabled: visible signal windowDestroyed(); @@ -125,7 +125,7 @@ Fadable { } function centerOrReposition() { - if (x == -9999 && y == -9999) { + if (x == desktop.INVALID_POSITION && y == desktop.INVALID_POSITION) { desktop.centerOnVisible(window); } else { desktop.repositionOnVisible(window);