Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: BlurArea unpack error in qt5 #236

Merged
merged 1 commit into from
Apr 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion xcb/dnotitlebarwindowhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,21 @@ void DNoTitlebarWindowHelper::updateWindowBlurAreasFromProperty()
{
const QVariant &v = m_window->property(windowBlurAreas);
const QVector<quint32> &tmpV = qvariant_cast<QVector<quint32>>(v);
const QVector<Utility::BlurArea> &a = *(reinterpret_cast<const QVector<Utility::BlurArea>*>(&tmpV));
const int OffSet = 6; // Utility::BlurArea's member variables
zccrs marked this conversation as resolved.
Show resolved Hide resolved
if (tmpV.size() % OffSet != 0)
qt_assert("windowBlurAreas's size must be round out BlurAreas's member variables.", __FILE__, __LINE__);

QVector<Utility::BlurArea> 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;
Expand Down
Loading