fix: dock hide behavior error when popup menu

Change-Id: Ie2247ffc2bfbd96b23655894ab36cfd9651b4546
This commit is contained in:
石博文 2017-11-07 11:53:39 +08:00 committed by Deepin Code Review
parent b1412526b3
commit ad3f979e2b
Notes: Deepin Code Review 2017-11-09 09:54:13 +08:00
Verified+1: Anonymous Coward #1000004
Verified+1: <yefei@linuxdeepin.com>
Code-Review+2: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Thu, 09 Nov 2017 09:54:12 +0800
Reviewed-on: https://cr.deepin.io/28050
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -459,7 +459,12 @@ void MainWindow::expand()
// qDebug() << "expand";
const QPoint finishPos(0, 0);
if (m_mainPanel->pos() == finishPos && m_mainPanel->size() == this->size() && m_panelHideAni->state() == QPropertyAnimation::Stopped)
const int epsilon = std::round(devicePixelRatioF()) - 1;
const QSize s = size();
const QSize ps = m_mainPanel->size();
if (m_mainPanel->pos() == finishPos && m_panelHideAni->state() == QPropertyAnimation::Stopped &&
std::abs(ps.width() - s.width()) <= epsilon && std::abs(ps.height() - s.height()) <= epsilon)
return;
m_panelHideAni->stop();
@ -520,7 +525,6 @@ void MainWindow::resetPanelEnvironment(const bool visible)
const Position position = m_settings->position();
const QRect r(m_settings->windowRect(position));
// qDebug() << Q_FUNC_INFO << r;
m_sizeChangeAni->setEndValue(r.size());
m_mainPanel->setFixedSize(r.size());
QWidget::setFixedSize(r.size());