From 168dce471e572617d1255d8dc1acac17733a3924 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Thu, 11 Apr 2024 02:22:51 +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/236 --- xcb/dnotitlebarwindowhelper.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xcb/dnotitlebarwindowhelper.cpp b/xcb/dnotitlebarwindowhelper.cpp index 727aeb4..65a4fd5 100644 --- a/xcb/dnotitlebarwindowhelper.cpp +++ b/xcb/dnotitlebarwindowhelper.cpp @@ -411,7 +411,21 @@ void DNoTitlebarWindowHelper::updateWindowBlurAreasFromProperty() { const QVariant &v = m_window->property(windowBlurAreas); const QVector &tmpV = qvariant_cast>(v); - const QVector &a = *(reinterpret_cast*>(&tmpV)); + const int OffSet = 6; // Utility::BlurArea's member variables + if (tmpV.size() % OffSet != 0) + qt_assert("windowBlurAreas's size must be round out BlurAreas's member variables.", __FILE__, __LINE__); + + QVector a; + for (int i = 0; i < tmpV.size(); i += OffSet) { + Utility::BlurArea area; + area.x = tmpV[i + 0]; + area.y = tmpV[i + 1]; + area.width = tmpV[i + 2]; + area.height = tmpV[i + 3]; + area.xRadius = tmpV[i + 4]; + area.yRaduis = tmpV[i + 5]; + a << area; + } if (a.isEmpty() && m_blurAreaList.isEmpty()) return;