diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/wayland/custom-extension/client-common/customextension.cpp | 7 |
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); |