From b26227348c5ecb73b78ee91db4e92e25eb048d7d Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 14 Dec 2021 11:06:39 +0200 Subject: [PATCH] wayland: Move or resize xdg-toplevel window during initialization only if geometry is enforced by a window rule move() and resize() functions are not convenience helpers around the moveResize() function. They communicate what kwin wants to see after the corresponding change is applied. It's needed to make asynchronous geometry updates work. This change replaces a moveResize() during XdgToplevelClient initialization with explicit move() and resize() function calls instead, so it's more clear what the expected end result is. --- src/xdgshellclient.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/xdgshellclient.cpp b/src/xdgshellclient.cpp index 31c980ad74..5409aedba4 100644 --- a/src/xdgshellclient.cpp +++ b/src/xdgshellclient.cpp @@ -1367,7 +1367,16 @@ void XdgToplevelClient::initialize() setupWindowRules(false); - moveResize(rules()->checkGeometry(frameGeometry(), true)); + // Move or resize the window only if enforced by a window rule. + const QPoint forcedPosition = rules()->checkPosition(invalidPoint, true); + if (forcedPosition != invalidPoint) { + move(forcedPosition); + } + const QSize forcedSize = rules()->checkSize(QSize(), true); + if (forcedSize.isValid()) { + resize(forcedSize); + } + maximize(rules()->checkMaximize(initialMaximizeMode(), true)); setFullScreen(rules()->checkFullScreen(initialFullScreenMode(), true), false); setOnActivities(rules()->checkActivity(activities(), true));