From ce5881086f32a2cc03c434965a86d160bf955d64 Mon Sep 17 00:00:00 2001
From: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Date: Fri, 25 Aug 2023 10:19:07 +0300
Subject: [PATCH] Client: Commit the initial surface state explicitly

QWaylandWindow lacks an explicit step to finish initializing the shell
surface by committing the surface. So far it used to work because of
hidden surface commits in
QWaylandWindow::handleContentOrientationChange(),
QWaylandWindow::setMask() and so on.

This change adds an explicit step to commit the initial surface state to
make the shell surface initialization robust.

Change-Id: Ibc38a4e0dbea689a727451c25a61af0270c7e548
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit 225432c2294bdfbf24856b2f155cd274b24543b2)
---
 src/client/qwaylandwindow.cpp | 2 ++
 1 file changed, 2 insertions(+)

--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -200,6 +200,8 @@ void QWaylandWindow::initWindow()
         mShellSurface->requestWindowStates(window()->windowStates());
     handleContentOrientationChange(window()->contentOrientation());
     mFlags = window()->flags();
+
+    mSurface->commit();
 }
 
 void QWaylandWindow::initializeWlSurface()
