summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDavid Edmundson <davidedmundson@kde.org>2019-06-23 15:09:51 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2020-04-28 10:33:22 +0000
commitcd21404f99b486ff62225699e1a4bdc0d5b3d5c1 (patch)
treeb9492ce1894abb5cab711681571c05204e43985b /examples
parent00c8a79da0c80616f18329cdfc61338a2c1af7df (diff)
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 Pick-to: 5.15 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>
Diffstat (limited to 'examples')
-rw-r--r--examples/wayland/custom-extension/client-common/customextension.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp
index aa0cb58a4..8b77c061a 100644
--- a/examples/wayland/custom-extension/client-common/customextension.cpp
+++ b/examples/wayland/custom-extension/client-common/customextension.cpp
@@ -81,8 +81,11 @@ QWindow *CustomExtension::windowForSurface(struct ::wl_surface *surface)
bool CustomExtension::eventFilter(QObject *object, QEvent *event)
{
- if (event->type() == QEvent::PlatformSurface
- && static_cast<QPlatformSurfaceEvent*>(event)->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) {
+ if (event->type() == QEvent::Expose) {
+ auto *exposeEvent = static_cast<QExposeEvent *>(event);
+ if (exposeEvent->region().isNull())
+ return false;
+
QWindow *window = qobject_cast<QWindow*>(object);
Q_ASSERT(window);
window->removeEventFilter(this);