fix: Popup Applet not hide when item removed

Change-Id: Ib698c731418a2a0d64739acae3c1bf14add1b8dc
This commit is contained in:
石博文 2018-03-27 17:39:29 +08:00
parent 0a0b60aa5f
commit 0e9d9df0e5
Notes: gerrit 2018-03-27 11:19:24 +00:00
Verified+1: Anonymous Coward #1000004
Code-Review+2: Rekols <rekols@foxmail.com>
Verified+1: <yefei@linuxdeepin.com>
Submitted-by: 石博文 <sbw@sbw.so>
Submitted-at: Tue, 27 Mar 2018 11:19:24 +0000
Reviewed-on: https://cr.deepin.io/33076
Project: dde/dde-dock
Branch: refs/heads/master
2 changed files with 9 additions and 1 deletions

View File

@ -329,6 +329,8 @@ void DockItemController::pluginItemInserted(PluginsItem *item)
void DockItemController::pluginItemRemoved(PluginsItem *item)
{
item->hidePopup();
if (m_containerItem->contains(item))
m_containerItem->removeItem(item);
else

View File

@ -123,7 +123,13 @@ bool DockPopupWindow::eventFilter(QObject *o, QEvent *e)
// FIXME: ensure position move after global mouse release event
if (isVisible())
QTimer::singleShot(10, this, [=] { show(m_lastPoint, m_model); });
{
QTimer::singleShot(10, this, [=] {
// NOTE(sbw): double check is necessary, in this time, the popup maybe already hided.
if (isVisible())
show(m_lastPoint, m_model);
});
}
return false;
}