summaryrefslogtreecommitdiffstats
path: root/src/opengl/qopenglcompositor.cpp
diff options
context:
space:
mode:
authorInho Lee <inho.lee@qt.io>2024-10-07 13:38:16 +0200
committerInho Lee <inho.lee@qt.io>2024-11-21 11:35:58 +0000
commit39bcd4287a6146e6deba9c6a9fdb70298deed427 (patch)
treea5b420722800ff59422d2a11923d2a808acf92cf /src/opengl/qopenglcompositor.cpp
parente54d4eabbeab3c010bc9367259d870bc1eeeadf7 (diff)
eglfs: change the condition to destroy the openglcompositor
With an openglcompositor, only first QEglFSWindow is set with a flag, HasNativeWindow and when it is destroyed, the openglcompositor is destroyed, too. For now, when using openglcompositor, Qt will not check HasNativeWindow for its nativeWindow because it is not possible to add a HasNativeWindow flag in an existing window. And the openglcompositor will be destroyed after the all the QEglFSWindows are closed. Fixes: QTBUG-129576 Pick-to: 6.8 6.5 Change-Id: I620a904a03d29e8db1738d9392f716b3ebf5b553 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/opengl/qopenglcompositor.cpp')
-rw-r--r--src/opengl/qopenglcompositor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/opengl/qopenglcompositor.cpp b/src/opengl/qopenglcompositor.cpp
index 3c5b1df9055..da6230e2241 100644
--- a/src/opengl/qopenglcompositor.cpp
+++ b/src/opengl/qopenglcompositor.cpp
@@ -273,9 +273,9 @@ void QOpenGLCompositor::addWindow(QOpenGLCompositorWindow *window)
void QOpenGLCompositor::removeWindow(QOpenGLCompositorWindow *window)
{
- m_windows.removeOne(window);
- if (!m_windows.isEmpty())
- emit topWindowChanged(m_windows.last());
+ bool couldChangeTopWindow = (m_windows.size() > 1) ? (window == m_windows.constLast()) : false;
+ if (m_windows.removeOne(window) && couldChangeTopWindow)
+ emit topWindowChanged(m_windows.constLast());
}
void QOpenGLCompositor::moveToTop(QOpenGLCompositorWindow *window)