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

c54cd9
From 14d066c61025e548227ccd8d655e80ffa31fa15e 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
c54cd9
Subject: [PATCH] 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>
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
c54cd9
index 1e8dc06f7..355aca864 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
c54cd9
index 5b1f4d56f..0079dfef8 100644
c54cd9
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
c54cd9
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
c54cd9
@@ -88,6 +88,7 @@ class QWaylandEglWindow : public QWaylandWindow
c54cd9
     mutable QOpenGLFramebufferObject *m_contentFBO = nullptr;
c54cd9
 
c54cd9
     QSurfaceFormat m_format;
c54cd9
+    QSize m_requestedSize;
c54cd9
 };
c54cd9
 
c54cd9
 }