aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSulfurNitride <lukew19@proton.me>2026-06-23 16:15:48 -0500
committerSulfurNitride <lukew19@proton.me>2026-06-23 16:15:48 -0500
commit59f3ba27e5d180c8e1861b41a1db3f58663bdd0f (patch)
tree85bdb72de77596637d1685b1f6d12b98cd2d1b07
parent08939441e50e52c685c531a16704fb8f6e1138bd (diff)
Let Wayland restore main window geometry
-rw-r--r--src/src/mainwindow.cpp12
1 files 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 <http://www.gnu.org/licenses/>.
#include <QAbstractItemDelegate>
#include <QAction>
#include <QApplication>
+#include <QGuiApplication>
#include <QBuffer>
#include <QButtonGroup>
#include <QCheckBox>
@@ -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);