Skip to content

Commit

Permalink
Merge "fix popup menu at efficient mode"
Browse files Browse the repository at this point in the history
  • Loading branch information
sbwtw authored and deepin-gerrit committed Aug 4, 2016
2 parents 3d39dc0 + 5d7e6c8 commit 146219b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion plugins/system-tray/traywidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ void TrayWidget::paintEvent(QPaintEvent *e)

void TrayWidget::mousePressEvent(QMouseEvent *e)
{
QWidget::mousePressEvent(e);
const QPoint point(e->pos() - rect().center());
if (point.manhattanLength() > 24)
return QWidget::mousePressEvent(e);

m_pressPoint = e->pos();
}
Expand All @@ -83,6 +85,10 @@ void TrayWidget::mouseReleaseEvent(QMouseEvent *e)
{
QWidget::mouseReleaseEvent(e);

const QPoint point(e->pos() - rect().center());
if (point.manhattanLength() > 24)
return;

const QPoint distance = e->pos() - m_pressPoint;
if (distance.manhattanLength() > DRAG_THRESHOLD)
return;
Expand Down

0 comments on commit 146219b

Please sign in to comment.