From 59f3ba27e5d180c8e1861b41a1db3f58663bdd0f Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Tue, 23 Jun 2026 16:15:48 -0500 Subject: Let Wayland restore main window geometry --- src/src/mainwindow.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/src/mainwindow.cpp b/src/src/mainwindow.cpp index 11f2cde..2f7193f 100644 --- a/src/src/mainwindow.cpp +++ b/src/src/mainwindow.cpp @@ -95,6 +95,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -2254,8 +2255,15 @@ void MainWindow::readSettings() { const auto& s = m_OrganizerCore.settings(); - if (!s.geometry().restoreGeometry(this)) { - resize(1300, 800); + // Qt Wayland's session-management client restores the geometry before the + // first surface commit. Calling restoreGeometry() ourselves races that + // protocol and prevents the compositor from restoring the prior window + // position. X11/XWayland still relies on the existing Qt geometry state. + if (!QGuiApplication::platformName().startsWith(QStringLiteral("wayland"), + Qt::CaseInsensitive)) { + if (!s.geometry().restoreGeometry(this)) { + resize(1300, 800); + } } s.geometry().restoreState(this); -- cgit v1.3.1