Fix dock moved to wrong position while animating

This commit may also fix the problem that Dock's position is not
correct in some circumstances.

Change-Id: I671aa441087a50f113a56decfe8895df28969930
This commit is contained in:
Hualet Wang 2017-06-15 09:10:29 +08:00
parent c252d5052a
commit 9715df2428
Notes: Deepin Code Review 2017-06-15 13:26:03 +08:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: Hualet Wang <mr.asianwang@gmail.com>
Submitted-by: Hualet Wang <mr.asianwang@gmail.com>
Submitted-at: Thu, 15 Jun 2017 13:26:01 +0800
Reviewed-on: https://cr.deepin.io/23843
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -113,7 +113,7 @@ void MainWindow::leaveEvent(QEvent *e)
void MainWindow::setFixedSize(const QSize &size)
{
const QPropertyAnimation::State state = m_posChangeAni->state();
const QPropertyAnimation::State state = m_sizeChangeAni->state();
if (state == QPropertyAnimation::Stopped && this->size() == size)
return;
@ -266,7 +266,10 @@ void MainWindow::updatePosition()
clearStrutPartial();
updateGeometry();
setStrutPartial();
// make sure strut partial is set after the size/position animation;
const int inter = qMax(m_sizeChangeAni->duration(), m_posChangeAni->duration());
QTimer::singleShot(inter + 100, this, &MainWindow::setStrutPartial);
}
void MainWindow::updateGeometry()