From 2f1c68e3ef342e679d622a7c2a8bbf787edb3750 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Thu, 28 Aug 2025 13:03:18 +0000 Subject: [PATCH] sync: from linuxdeepin/qt5platform-plugins Synchronize source files from linuxdeepin/qt5platform-plugins. Source-pull-request: https://github.com/linuxdeepin/qt5platform-plugins/pull/301 --- src/dbackingstoreproxy.cpp | 7 ++++++- src/dbackingstoreproxy.h | 6 +++++- wayland/dwayland/dhighdpi.cpp | 7 +++++++ xcb/dhighdpi.cpp | 6 ++++++ 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/dbackingstoreproxy.cpp b/src/dbackingstoreproxy.cpp index eaad729..f421c0f 100644 --- a/src/dbackingstoreproxy.cpp +++ b/src/dbackingstoreproxy.cpp @@ -136,11 +136,16 @@ void DBackingStoreProxy::composeAndFlush(QWindow *window, const QRegion ®ion, { m_proxy->composeAndFlush(window, region, offset, textures, translucentBackground); } -#else +#elif QT_VERSION < QT_VERSION_CHECK(6, 9, 2) QPlatformBackingStore::FlushResult DBackingStoreProxy::rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) { return m_proxy->rhiFlush(window, sourceDevicePixelRatio, region, offset, textures, translucentBackground); } +#else +QPlatformBackingStore::FlushResult DBackingStoreProxy::rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground, qreal sourceTransformFactor) +{ + return m_proxy->rhiFlush(window, sourceDevicePixelRatio, region, offset, textures, translucentBackground, sourceTransformFactor); +} #endif #if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) diff --git a/src/dbackingstoreproxy.h b/src/dbackingstoreproxy.h index f892554..be85ac9 100644 --- a/src/dbackingstoreproxy.h +++ b/src/dbackingstoreproxy.h @@ -40,10 +40,14 @@ class DBackingStoreProxy : public QPlatformBackingStore void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; -#else +#elif QT_VERSION < QT_VERSION_CHECK(6, 9, 2) FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) override; +#else + FlushResult rhiFlush(QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, + const QPoint &offset, QPlatformTextureList *textures, + bool translucentBackground, qreal sourceTransformFactor = 0) override; #endif #if QT_VERSION <= QT_VERSION_CHECK(6, 2, 4) GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, TextureFlags *flags) const override; diff --git a/wayland/dwayland/dhighdpi.cpp b/wayland/dwayland/dhighdpi.cpp index 4d2cce7..4ff17f4 100755 --- a/wayland/dwayland/dhighdpi.cpp +++ b/wayland/dwayland/dhighdpi.cpp @@ -170,7 +170,14 @@ void DHighDpi::removeScreenFactorCache(QScreen *screen) // qDebug()<devicePixelRatio(); // 更新窗口大小 if (window->handle()) { +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 2) QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window)); +#else + QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, + QHighDpi::fromNativeWindowGeometry(window->handle()->geometry(), window), + QHighDpi::fromNativePixels(window->handle()->geometry(), window)); +#endif + QGuiApplicationPrivate::processGeometryChangeEvent(&gce); } } diff --git a/xcb/dhighdpi.cpp b/xcb/dhighdpi.cpp index 45cda3d..023c55a 100644 --- a/xcb/dhighdpi.cpp +++ b/xcb/dhighdpi.cpp @@ -186,7 +186,13 @@ void DHighDpi::onDPIChanged(xcb_connection_t *connection, const QByteArray &name // 更新窗口大小 if (window->handle()) { +#if QT_VERSION < QT_VERSION_CHECK(6, 9, 2) QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, QHighDpi::fromNativePixels(window->handle()->geometry(), window)); +#else + QWindowSystemInterfacePrivate::GeometryChangeEvent gce(window, + QHighDpi::fromNativeWindowGeometry(window->handle()->geometry(), window), + QHighDpi::fromNativePixels(window->handle()->geometry(), window)); +#endif QGuiApplicationPrivate::processGeometryChangeEvent(&gce); } }