mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: disk popup does not hide
Disk popup does hide after all disks are ejected. Hide popup of a pluin in itemRemoved, and notify the DockPopupWindow to hide too. Log: fix disk popup does not hide Issue: 3813
This commit is contained in:
parent
0781957e4e
commit
b69a220b05
@ -155,16 +155,27 @@ void DockPopupWindow::enterEvent(QEvent *e)
|
|||||||
|
|
||||||
bool DockPopupWindow::eventFilter(QObject *o, QEvent *e)
|
bool DockPopupWindow::eventFilter(QObject *o, QEvent *e)
|
||||||
{
|
{
|
||||||
if (o != getContent() || e->type() != QEvent::Resize)
|
if (o != getContent())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// FIXME: ensure position move after global mouse release event
|
switch(e->type()) {
|
||||||
if (isVisible()) {
|
case QEvent::Resize: {
|
||||||
QTimer::singleShot(10, this, [=] {
|
// FIXME: ensure position move after global mouse release event
|
||||||
// NOTE(sbw): double check is necessary, in this time, the popup maybe already hided.
|
if (isVisible()) {
|
||||||
if (isVisible())
|
QTimer::singleShot(10, this, [=] {
|
||||||
show(m_lastPoint, m_model);
|
// NOTE(sbw): double check is necessary, in this time, the popup maybe already hided.
|
||||||
});
|
if (isVisible())
|
||||||
|
show(m_lastPoint, m_model);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case QEvent::Hide: {
|
||||||
|
this->hide();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -260,6 +260,10 @@ void DockPluginController::removePluginItem(PluginsItemInterface * const itemInt
|
|||||||
PluginInfo *pluginInfo = static_cast<PluginInfo *>(interfaceData[PLUGININFO]);
|
PluginInfo *pluginInfo = static_cast<PluginInfo *>(interfaceData[PLUGININFO]);
|
||||||
// 将是否在任务栏显示的标记改为不显示
|
// 将是否在任务栏显示的标记改为不显示
|
||||||
pluginInfo->m_visible = false;
|
pluginInfo->m_visible = false;
|
||||||
|
|
||||||
|
if (QWidget * popup = itemInter->itemPopupApplet(itemKey))
|
||||||
|
popup->hide();
|
||||||
|
|
||||||
m_proxyInter->itemRemoved(itemInter, itemKey);
|
m_proxyInter->itemRemoved(itemInter, itemKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user