summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2020-04-08 18:19:00 +0100
committerDavid Edmundson <davidedmundson@kde.org>2020-04-23 09:49:31 +0100
commit4bd13402f0293e85b8dfdf92254e250ac28094c7 (patch)
treeafe0ec21e045a8089971f2c7b0c6f3b3f36f6d7c
parentb69e62f7b5d11990c2b75045ec67d7179e823e17 (diff)
Client: Reset wl_egl_window before wl_surface
Semantically we want things in this order as wl_egl_window_create takes a reference to the wl_surface. Teardown typically is the opposite of construction. This brings us in line with GTK which also tears down in this order. This fixes a repeatable crash when using Nvidia's EGLStreams and closing a window. Change-Id: I356dfbba9a7315717c8ecdc7023ca7b047622697 Reviewed-by: Frederik Gladhorn <gladhorn@kde.org> Reviewed-by: Johan Helsing <johanhelsing@gmail.com>
-rw-r--r--src/client/qwaylandwindow.cpp2
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp7
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h1
3 files changed, 2 insertions, 8 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp
index 5830c1368..9fa2f15f5 100644
--- a/src/client/qwaylandwindow.cpp
+++ b/src/client/qwaylandwindow.cpp
@@ -244,6 +244,8 @@ void QWaylandWindow::reset(bool sendDestroyEvent)
mShellSurface = nullptr;
delete mSubSurfaceWindow;
mSubSurfaceWindow = nullptr;
+
+ invalidateSurface();
if (mSurface) {
emit wlSurfaceDestroyed();
QWriteLocker lock(&mSurfaceLock);
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
index e8d43fad4..7889f575f 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.cpp
@@ -162,13 +162,6 @@ QSurfaceFormat QWaylandEglWindow::format() const
return m_format;
}
-void QWaylandEglWindow::setVisible(bool visible)
-{
- QWaylandWindow::setVisible(visible);
- if (!visible)
- invalidateSurface();
-}
-
void QWaylandEglWindow::invalidateSurface()
{
if (m_eglSurface) {
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
index 878532afc..5b1f4d56f 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandeglwindow.h
@@ -75,7 +75,6 @@ public:
void bindContentFBO();
void invalidateSurface() override;
- void setVisible(bool visible) override;
private:
QWaylandEglClientBufferIntegration *m_clientBufferIntegration = nullptr;