From 5d7e6c8866275ec72b14f5a045204483ed76d88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E5=8D=9A=E6=96=87?= Date: Thu, 4 Aug 2016 16:54:10 +0800 Subject: [PATCH] fix popup menu at efficient mode Change-Id: Ic1f80eaa718915d9b7112e826a111648fe198cba --- plugins/system-tray/traywidget.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/system-tray/traywidget.cpp b/plugins/system-tray/traywidget.cpp index 2cca4093b..18e9cb694 100644 --- a/plugins/system-tray/traywidget.cpp +++ b/plugins/system-tray/traywidget.cpp @@ -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(); } @@ -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;