diff options
author | David Edmundson <davidedmundson@kde.org> | 2019-06-23 15:09:51 +0200 |
---|---|---|
committer | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-05-18 14:05:33 +0000 |
commit | e18cfb5a129afb3e5e2f429436277ae4dc565e6e (patch) | |
tree | 5793225e58a73f64a617f2a3c74cffa16c42f957 /src/client/qwaylandwindow.cpp | |
parent | 76eda41dab9ddccf4c2a38d981c9b03bc7f051d0 (diff) | |
download | qtwayland-e18cfb5a129afb3e5e2f429436277ae4dc565e6e.tar.gz |
Client: Don't send fake SurfaceCreated/Destroyed events
QPlatformSurface relates to the platform window, not the wl_surface.
The events are already emitted by QPlatformWindow on create/destroy.
To preserve compatibility for a previous KDE version it was faked to
emit the events when the wl_surface is created/hidden to keep behavior.
This is no longer necessary, and it has caused multiple errors, the latest
being a crash when switching between sub-menus with the Sway compositor.
[ChangeLog][QPA plugin] QWaylandWindow no longer sends fake SurfaceCreated/Destroyed events.
Use expose events to be notified when a Wayland surface appears.
Task-number: QTBUG-76324
Fixes: QTBUG-81952
Change-Id: I2f003bc9da85f032a0053677fd281152099fc9eb
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
(cherry picked from commit cd21404f99b486ff62225699e1a4bdc0d5b3d5c1)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/client/qwaylandwindow.cpp')
-rw-r--r-- | src/client/qwaylandwindow.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/client/qwaylandwindow.cpp b/src/client/qwaylandwindow.cpp index 0545c80f..cb364d6a 100644 --- a/src/client/qwaylandwindow.cpp +++ b/src/client/qwaylandwindow.cpp @@ -98,7 +98,7 @@ QWaylandWindow::~QWaylandWindow() delete mWindowDecoration; if (mSurface) - reset(false); + reset(); const QWindow *parent = window(); const auto tlw = QGuiApplication::topLevelWindows(); @@ -125,8 +125,6 @@ void QWaylandWindow::initWindow() if (!mSurface) { initializeWlSurface(); - QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated); - QGuiApplication::sendEvent(window(), &e); } if (shouldCreateSubSurface()) { @@ -241,12 +239,8 @@ bool QWaylandWindow::shouldCreateSubSurface() const return QPlatformWindow::parent() != nullptr; } -void QWaylandWindow::reset(bool sendDestroyEvent) +void QWaylandWindow::reset() { - if (mSurface && sendDestroyEvent) { - QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed); - QGuiApplication::sendEvent(window(), &e); - } delete mShellSurface; mShellSurface = nullptr; delete mSubSurfaceWindow; |