From 369a5296a99b4a731747d183ba81333253846997 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 2 Aug 2023 08:28:52 +0200 Subject: [PATCH] QWaylandWindow: adapt to QPlatformWindow::setBackingStore() addition When qtbase/a4ca9e80658bca7dad1529f03c1b59173a6ecf62 added a virtual QPlatformWindow::setBackingStore(), this was hidden by the existing QWaylandWindow::setBackingStore(), causing a FTBFS on -developer-builds. Fix by using the newly-added detection macro to turn the existing function into an overrider. Pick-to: 6.6 Fixes: QTBUG-115691 Task-number: QTBUG-97482 Change-Id: If1d8c4443fe50030addb23331a50b7b9e1274626 Reviewed-by: Axel Spoerl Reviewed-by: David Edmundson --- src/plugins/platforms/wayland/qwaylandwindow.cpp | 7 +++++++ src/plugins/platforms/wayland/qwaylandwindow_p.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index 505836296c4..d7bb6c6529a 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -1500,6 +1500,13 @@ QVariant QWaylandWindow::property(const QString &name, const QVariant &defaultVa return m_properties.value(name, defaultValue); } +#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE +void QWaylandWindow::setBackingStore(QPlatformBackingStore *store) +{ + mBackingStore = dynamic_cast(store); +} +#endif + void QWaylandWindow::timerEvent(QTimerEvent *event) { if (event->timerId() != mFrameCallbackCheckIntervalTimerId) diff --git a/src/plugins/platforms/wayland/qwaylandwindow_p.h b/src/plugins/platforms/wayland/qwaylandwindow_p.h index 042ea56603b..17140c52e9f 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow_p.h +++ b/src/plugins/platforms/wayland/qwaylandwindow_p.h @@ -201,7 +201,11 @@ public: QVariant property(const QString &name); QVariant property(const QString &name, const QVariant &defaultValue); +#ifdef QT_PLATFORM_WINDOW_HAS_VIRTUAL_SET_BACKING_STORE + void setBackingStore(QPlatformBackingStore *store) override; +#else void setBackingStore(QWaylandShmBackingStore *backingStore) { mBackingStore = backingStore; } +#endif QWaylandShmBackingStore *backingStore() const { return mBackingStore; } void setShellIntegration(QWaylandShellIntegration *shellIntegration);