fix window pos error because of we passed plugins

Change-Id: Ie09dd89a998eaa019094008234f96b1ca8163189
This commit is contained in:
石博文 2017-06-08 16:00:45 +08:00
parent 2a28205979
commit 837db1f839
Notes: Deepin Code Review 2017-06-08 16:02:55 +08:00
Code-Review+2: 石博文 <sbw@sbw.so>
Verified+1: 石博文 <sbw@sbw.so>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Thu, 08 Jun 2017 16:02:52 +0800
Reviewed-on: https://cr.deepin.io/23706
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 6 additions and 6 deletions

View File

@ -23,7 +23,7 @@ MainWindow::MainWindow(QWidget *parent)
m_positionUpdateTimer(new QTimer(this)),
m_expandDelayTimer(new QTimer(this)),
m_sizeChangeAni(new QPropertyAnimation(this, "size")),
m_posChangeAni(new QVariantAnimation(this)),
m_posChangeAni(new QPropertyAnimation(this, "pos")),
m_panelShowAni(new QPropertyAnimation(m_mainPanel, "pos")),
m_panelHideAni(new QPropertyAnimation(m_mainPanel, "pos")),
m_xcbMisc(XcbMisc::instance())
@ -53,8 +53,8 @@ MainWindow::MainWindow(QWidget *parent)
connect(&m_platformWindowHandle, &DPlatformWindowHandle::frameMarginsChanged, this, &MainWindow::adjustShadowMask);
connect(m_panelHideAni, &QPropertyAnimation::finished, this, &MainWindow::adjustShadowMask);
connect(m_panelShowAni, &QPropertyAnimation::finished, this, &MainWindow::adjustShadowMask);
connect(m_posChangeAni, &QPropertyAnimation::valueChanged,
this, [=](const QVariant &v) { const QPoint p = v.toPoint(); x11MoveWindow(p.x(), p.y()); });
// connect(m_posChangeAni, &QPropertyAnimation::valueChanged,
// this, [=](const QVariant &v) { const QPoint p = v.toPoint(); x11MoveWindow(p.x(), p.y()); });
}
MainWindow::~MainWindow()
@ -129,7 +129,7 @@ void MainWindow::setFixedSize(const QSize &size)
void MainWindow::move(int x, int y)
{
const QPropertyAnimation::State state = m_posChangeAni->state();
const QPoint p = x11GetWindowPos();
const QPoint p = pos();
const QPoint tp = QPoint(x, y);
if (state == QPropertyAnimation::Stopped && p == tp)
@ -514,7 +514,7 @@ void MainWindow::updatePanelVisible()
if (!m_settings->autoHide())
break;
QRect r(x11GetWindowPos(), size());
QRect r(pos(), size());
if (r.contains(QCursor::pos()))
break;

View File

@ -68,7 +68,7 @@ private:
QTimer *m_positionUpdateTimer;
QTimer *m_expandDelayTimer;
QPropertyAnimation *m_sizeChangeAni;
QVariantAnimation *m_posChangeAni;
QPropertyAnimation *m_posChangeAni;
QPropertyAnimation *m_panelShowAni;
QPropertyAnimation *m_panelHideAni;