Blame SOURCES/0021-Fix-issue-with-repeated-window-size-changes.patch

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