aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);