fix: 任务栏切换位置后模糊特效异常

本意为:在任务栏属性改变需要调整圆角时,用一个QTimer统一处理,避免重复调用,
但是由于我们这边做了一次裁剪区域,窗管根据我们设置的圆角半径也会裁剪一次,导致最后模糊特效出现异常。
故这里去掉设置裁剪区域,并整理了一下代码结构。

Log: 修复任务栏切换位置模糊特效异常的问题。
Bug: https://pms.uniontech.com/zentao/bug-view-59099.html
Change-Id: Idead1337e5dae432912fe7eb087d9012746247a1
This commit is contained in:
Zhang Qipeng 2020-12-29 10:06:10 +08:00
parent 3b3c303bf9
commit 6929caf73a

View File

@ -355,30 +355,20 @@ void MainWindow::getTrayVisableItemCount()
void MainWindow::adjustShadowMask()
{
if (!m_launched)
if (!m_launched || m_shadowMaskOptimizeTimer->isActive())
return;
if (m_shadowMaskOptimizeTimer->isActive())
return;
const bool composite = m_wmHelper->hasComposite();
const bool isFasion = m_multiScreenWorker->displayMode() == Fashion;
DStyleHelper dstyle(style());
int radius = dstyle.pixelMetric(DStyle::PM_TopLevelWindowRadius);
if (Dtk::Core::DSysInfo::isCommunityEdition()) {
auto theme = DGuiApplicationHelper::instance()->systemTheme();
radius = theme->windowRadius(radius);
int radius = 0;
if (m_wmHelper->hasComposite() && m_multiScreenWorker->displayMode() == DisplayMode::Fashion) {
if (Dtk::Core::DSysInfo::isCommunityEdition()) { // 社区版圆角与专业版不同
DPlatformTheme *theme = DGuiApplicationHelper::instance()->systemTheme();
radius = theme->windowRadius(radius);
} else {
radius = dstyle.pixelMetric(DStyle::PM_TopLevelWindowRadius);
}
}
int newRadius = composite && isFasion ? radius : 0;
m_platformWindowHandle.setWindowRadius(newRadius);
QPainterPath clipPath;
clipPath.addRect(QRect(QPoint(0, 0), this->geometry().size()));
m_platformWindowHandle.setClipPath(newRadius != 0 ? QPainterPath() : clipPath);
m_platformWindowHandle.setWindowRadius(radius);
}
void MainWindow::onDbusNameOwnerChanged(const QString &name, const QString &oldOwner, const QString &newOwner)