mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +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)
|
||||
{
|
||||
if (o != getContent() || e->type() != QEvent::Resize)
|
||||
if (o != getContent())
|
||||
return false;
|
||||
|
||||
// FIXME: ensure position move after global mouse release event
|
||||
if (isVisible()) {
|
||||
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);
|
||||
});
|
||||
switch(e->type()) {
|
||||
case QEvent::Resize: {
|
||||
// FIXME: ensure position move after global mouse release event
|
||||
if (isVisible()) {
|
||||
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);
|
||||
});
|
||||
}
|
||||
break;
|
||||
}
|
||||
case QEvent::Hide: {
|
||||
this->hide();
|
||||
break;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -260,6 +260,10 @@ void DockPluginController::removePluginItem(PluginsItemInterface * const itemInt
|
||||
PluginInfo *pluginInfo = static_cast<PluginInfo *>(interfaceData[PLUGININFO]);
|
||||
// 将是否在任务栏显示的标记改为不显示
|
||||
pluginInfo->m_visible = false;
|
||||
|
||||
if (QWidget * popup = itemInter->itemPopupApplet(itemKey))
|
||||
popup->hide();
|
||||
|
||||
m_proxyInter->itemRemoved(itemInter, itemKey);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user