Commit 588e192a authored by Benoît Minisini's avatar Benoît Minisini
Browse files

Realize the window widget before trying to center it, as we need the monitor it is displayed on.

[GB.GTK]
* BUG: Realize the window widget before trying to center it, as we need the monitor it is displayed on.

[GB.GTK3]
* BUG: Realize the window widget before trying to center it, as we need the monitor it is displayed on.
parent 6ffcf98d
Pipeline #356853531 failed with stage
in 26 minutes and 9 seconds
......@@ -998,22 +998,19 @@ void gMainWindow::center()
if (MAIN_platform_is_wayland)
gtk_window_set_position(GTK_WINDOW(border), GTK_WIN_POS_CENTER_ON_PARENT);
else
gtk_window_set_position(GTK_WINDOW(border), GTK_WIN_POS_CENTER_ALWAYS);
#else
#endif
GdkRectangle rect;
int x, y;
gtk_widget_realize(border);
gDesktop::availableGeometry(screen(), &rect);
x = rect.x + (rect.width - width()) / 2;
y = rect.y + (rect.height - height()) / 2;
move(x, y);
#endif
}
bool gMainWindow::isModal() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment