summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/window.cpp')
-rw-r--r--src/gui/widgets/window.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 6290ef62..e09986d2 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -765,7 +765,10 @@ void Window::redraw()
void Window::center()
{
- setLocationRelativeTo(getParent());
+ if (auto window = getParentWindow())
+ setLocationRelativeTo(window);
+ else
+ setLocationRelativeTo(getParent());
}
void Window::ensureOnScreen()