From c0aa61347bc0edb51909253774c7efcbae9e8352 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 51/55] 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(+)

diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 5d01507d..5eee0414 100644
--- 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()
-- 
2.52.0

