fix: place holder item not be removed after drag leave in touch screen

remove margins to fix a touch screen bug:
the mouse point position will stay on this rect's margins after
drag move to the edge of screen

https://tower.im/teams/9487/todos/225361/

Change-Id: I7e7c2d3886c220e22da91c27b2afba432ec7b81d
This commit is contained in:
listenerri 2019-01-23 17:44:34 +08:00
parent 2d39e69ee8
commit 12cf14a863
Notes: gerrit 2019-01-24 10:04:53 +08:00
Verified+1: <jenkins@deepin.com>
Code-Review+2: listenerri <listenerri@gmail.com>
Submitted-by: listenerri <listenerri@gmail.com>
Submitted-at: Thu, 24 Jan 2019 10:04:52 +0800
Reviewed-on: https://cr.deepin.io/41447
Project: dde/dde-dock
Branch: refs/heads/master

View File

@ -302,7 +302,10 @@ void MainPanel::dragLeaveEvent(QDragLeaveEvent *e)
const QRect r(static_cast<QWidget *>(parent())->pos(), size());
const QPoint p(QCursor::pos());
if (r.contains(p))
// remove margins to fix a touch screen bug:
// the mouse point position will stay on this rect's margins after
// drag move to the edge of screen
if (r.marginsRemoved(QMargins(1,1,1,1)).contains(p))
return;
m_itemController->placeholderItemRemoved(RequestDockItem);