Blame SOURCES/qtwayland-fix-issue-with-repeated-window-size-changes.patch

0cfe39
From 14d066c61025e548227ccd8d655e80ffa31fa15e Mon Sep 17 00:00:00 2001
0cfe39
From: Jaeyoon Jung <jaeyoon.jung@lge.com>
0cfe39
Date: Mon, 15 Feb 2021 08:31:06 +0900
0cfe39
Subject: [PATCH] Fix issue with repeated window size changes
0cfe39
0cfe39
Check if the new window size is different from the size requested
0cfe39
previously before calling wl_egl_window_resize. It addresses the issue
0cfe39
where repeated setGeometry calls between two sizes might not work as
0cfe39
expected. The problem occurs when wl_egl_window_get_attached_size does
0cfe39
not get the same size that was requested by the previous setGeometry
0cfe39
call. If the returned size happened to match the new size instead,
0cfe39
we would mistakenly skip the resize.
0cfe39
0cfe39
Change-Id: Iafe4a91cc707f854b9099b6109b6be1423d7bd29
0cfe39
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
0cfe39
---
0cfe39
 .../client/wayland-egl/qwaylandeglwindow.cpp                  | 4 +++-
0cfe39
 .../client/wayland-egl/qwaylandeglwindow.h                    | 1 +
0cfe39
 2 files changed, 4 insertions(+), 1 deletion(-)
0cfe39
0cfe39
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
0cfe39
index 1e8dc06f7..355aca864 100644
0cfe39
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
0cfe39
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
0cfe39
@@ -131,14 +131,16 @@ void QWaylandEglWindow::updateSurface(bool create)
0cfe39
             if (!disableResizeCheck) {
0cfe39
                 wl_egl_window_get_attached_size(m_waylandEglWindow, &current_width, &current_height);
0cfe39
             }
0cfe39
-            if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height())) {
0cfe39
+            if (disableResizeCheck || (current_width != sizeWithMargins.width() || current_height != sizeWithMargins.height()) || m_requestedSize != sizeWithMargins) {
0cfe39
                 wl_egl_window_resize(m_waylandEglWindow, sizeWithMargins.width(), sizeWithMargins.height(), mOffset.x(), mOffset.y());
0cfe39
+                m_requestedSize = sizeWithMargins;
0cfe39
                 mOffset = QPoint();
0cfe39
 
0cfe39
                 m_resize = true;
0cfe39
             }
0cfe39
         } else if (create && wlSurface()) {
0cfe39
             m_waylandEglWindow = wl_egl_window_create(wlSurface(), sizeWithMargins.width(), sizeWithMargins.height());
0cfe39
+            m_requestedSize = sizeWithMargins;
0cfe39
         }
0cfe39
 
0cfe39
         if (!m_eglSurface && m_waylandEglWindow && create) {
0cfe39
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
0cfe39
index 5b1f4d56f..0079dfef8 100644
0cfe39
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
0cfe39
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
0cfe39
@@ -88,6 +88,7 @@ class QWaylandEglWindow : public QWaylandWindow
0cfe39
     mutable QOpenGLFramebufferObject *m_contentFBO = nullptr;
0cfe39
 
0cfe39
     QSurfaceFormat m_format;
0cfe39
+    QSize m_requestedSize;
0cfe39
 };
0cfe39
 
0cfe39
 }