summaryrefslogtreecommitdiff
path: root/examples/wayland
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2021-05-14 10:35:53 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2021-05-14 18:11:30 +0200
commit6aab3cbba0f9df3141cafd571f621610c94eaf1c (patch)
treecd50d37fdca29dfc80c64fe7ea592c051240b4f0 /examples/wayland
parentd533901938a996367d7b6f87b0214f5a17098aed (diff)
downloadqtwayland-6aab3cbba0f9df3141cafd571f621610c94eaf1c.tar.gz
Don't use deprecated API
QExposeEvent::region() is deprecated. Fixes: QTBUG-93751 Pick-to: 6.1 Change-Id: Idaff6fdc4c88e70696ba0074e26db3505c48b9d0 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'examples/wayland')
-rw-r--r--examples/wayland/custom-extension/client-common/customextension.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp
index 8b77c061..d7ef3f04 100644
--- a/examples/wayland/custom-extension/client-common/customextension.cpp
+++ b/examples/wayland/custom-extension/client-common/customextension.cpp
@@ -82,14 +82,12 @@ QWindow *CustomExtension::windowForSurface(struct ::wl_surface *surface)
bool CustomExtension::eventFilter(QObject *object, QEvent *event)
{
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);
- QtWayland::qt_example_extension::register_surface(getWlSurface(window));
+ if (window->isExposed()) {
+ window->removeEventFilter(this);
+ QtWayland::qt_example_extension::register_surface(getWlSurface(window));
+ }
}
return false;
}