mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 修复2D情况下仍然使用动画的情况
2D情况下,未及时更新动画的过渡时间 Log: 修复2D情况下仍然使用动画的情况 Change-Id: I5fe92eb0769e82edbb957b8c247d5b00e955902e Reviewed-on: http://gerrit.uniontech.com/c/dde-dock/+/1462 Reviewed-by: fanpengcheng <fanpengcheng@uniontech.com> Tested-by: fanpengcheng <fanpengcheng@uniontech.com>
This commit is contained in:
parent
1170afd823
commit
2d93feb822
@ -221,9 +221,6 @@ void MultiScreenWorker::handleDbusSignal(QDBusMessage msg)
|
|||||||
|
|
||||||
void MultiScreenWorker::onRegionMonitorChanged(int x, int y, const QString &key)
|
void MultiScreenWorker::onRegionMonitorChanged(int x, int y, const QString &key)
|
||||||
{
|
{
|
||||||
if (m_registerKey != key)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// 鼠标按下状态不响应唤醒
|
// 鼠标按下状态不响应唤醒
|
||||||
if (m_btnPress)
|
if (m_btnPress)
|
||||||
return;
|
return;
|
||||||
@ -233,6 +230,21 @@ void MultiScreenWorker::onRegionMonitorChanged(int x, int y, const QString &key)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 这里收到鼠标事件是全局的,不应该仅仅是任务栏唤醒区域之内的,所以要放在判断m_registerKey之前
|
||||||
|
if (m_hideMode == HideMode::KeepHidden || m_hideMode == HideMode::SmartHide) {
|
||||||
|
// 应该隐藏掉
|
||||||
|
QRect rect = dockRect(m_ds.current(), m_position, HideMode::KeepShowing, m_displayMode);
|
||||||
|
QRect realRect { rect.topLeft(), rect.size() *qApp->devicePixelRatio() };
|
||||||
|
const QRect boundRect = parent()->visibleRegion().boundingRect();
|
||||||
|
if (!realRect.contains(QPoint(x, y)) && !boundRect.size().isEmpty() && !m_launcherInter->IsVisible() && m_autoHide) {
|
||||||
|
if (m_hideMode == HideMode::KeepHidden || (m_hideMode == HideMode::SmartHide && m_hideState == HideState::Hide))
|
||||||
|
hideAni(m_ds.current());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_registerKey != key)
|
||||||
|
return;
|
||||||
|
|
||||||
QString toScreen;
|
QString toScreen;
|
||||||
QScreen *screen = Utils::screenAtByScaled(QPoint(x, y));
|
QScreen *screen = Utils::screenAtByScaled(QPoint(x, y));
|
||||||
if (!screen) {
|
if (!screen) {
|
||||||
@ -873,6 +885,19 @@ void MultiScreenWorker::initConnection()
|
|||||||
connect(m_showAni, &QVariantAnimation::finished, this, &MultiScreenWorker::showAniFinished);
|
connect(m_showAni, &QVariantAnimation::finished, this, &MultiScreenWorker::showAniFinished);
|
||||||
connect(m_hideAni, &QVariantAnimation::finished, this, &MultiScreenWorker::hideAniFinished);
|
connect(m_hideAni, &QVariantAnimation::finished, this, &MultiScreenWorker::hideAniFinished);
|
||||||
|
|
||||||
|
connect(m_wmHelper, &DWindowManagerHelper::hasCompositeChanged, this, [ = ] {
|
||||||
|
const bool composite = m_wmHelper->hasComposite();
|
||||||
|
|
||||||
|
#ifndef DISABLE_SHOW_ANIMATION
|
||||||
|
const int duration = composite ? ANIMATIONTIME : 0;
|
||||||
|
#else
|
||||||
|
const int duration = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
m_showAni->setDuration(duration);
|
||||||
|
m_hideAni->setDuration(duration);
|
||||||
|
});
|
||||||
|
|
||||||
//FIX: 这里关联信号有时候收不到,未查明原因,handleDbusSignal处理
|
//FIX: 这里关联信号有时候收不到,未查明原因,handleDbusSignal处理
|
||||||
#if 0
|
#if 0
|
||||||
// connect(m_dockInter, &DBusDock::PositionChanged, this, &MultiScreenWorker::onPositionChanged);
|
// connect(m_dockInter, &DBusDock::PositionChanged, this, &MultiScreenWorker::onPositionChanged);
|
||||||
@ -1288,8 +1313,7 @@ QRect MultiScreenWorker::getDockShowGeometry(const QString &screenName, const Po
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
foreach (Monitor *inter, validMonitorList(m_monitorInfo)) {
|
foreach (Monitor *inter, validMonitorList(m_monitorInfo)) {
|
||||||
if (inter->name() == screenName) {
|
if (inter->name() == screenName) {
|
||||||
const int dockSize = int(displaymode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() : m_dockInter->windowSizeEfficient());
|
const int dockSize = int(displaymode == DisplayMode::Fashion ? m_dockInter->windowSizeFashion() : m_dockInter->windowSizeEfficient());
|
||||||
@ -1379,8 +1403,7 @@ QRect MultiScreenWorker::getDockHideGeometry(const QString &screenName, const Po
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
foreach (Monitor *inter, validMonitorList(m_monitorInfo)) {
|
foreach (Monitor *inter, validMonitorList(m_monitorInfo)) {
|
||||||
if (inter->name() == screenName) {
|
if (inter->name() == screenName) {
|
||||||
const int margin = (displaymode == DisplayMode::Fashion ? WINDOWMARGIN : 0);
|
const int margin = (displaymode == DisplayMode::Fashion ? WINDOWMARGIN : 0);
|
||||||
|
@ -342,7 +342,7 @@ private:
|
|||||||
QString m_leaveRegisterKey;
|
QString m_leaveRegisterKey;
|
||||||
bool m_aniStart; // changeDockPosition是否正在运行中
|
bool m_aniStart; // changeDockPosition是否正在运行中
|
||||||
bool m_draging; // 鼠标是否正在调整任务栏的宽度或高度
|
bool m_draging; // 鼠标是否正在调整任务栏的宽度或高度
|
||||||
bool m_autoHide; // 和DockSettings保持一致,可以直接使用其单例进行获取
|
bool m_autoHide; // 和MenuWorker保持一致,为false时表示菜单已经打开
|
||||||
bool m_btnPress; // 鼠标按下时移动到唤醒区域不应该响应唤醒
|
bool m_btnPress; // 鼠标按下时移动到唤醒区域不应该响应唤醒
|
||||||
QList<MonitRect> m_monitorRectList; // 监听唤起任务栏区域
|
QList<MonitRect> m_monitorRectList; // 监听唤起任务栏区域
|
||||||
/*****************************************************************/
|
/*****************************************************************/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user