diff --git a/frame/layershell/x11dlayershellemulation.cpp b/frame/layershell/x11dlayershellemulation.cpp index 5677594f0..d871812e0 100644 --- a/frame/layershell/x11dlayershellemulation.cpp +++ b/frame/layershell/x11dlayershellemulation.cpp @@ -151,7 +151,7 @@ void LayerShellEmulation::onPositionChanged() void LayerShellEmulation::onExclusionZoneChanged() { // dde-shell issues:379 - if (m_dlayerShellWindow->exclusionZone() <= 0) + if (m_dlayerShellWindow->exclusionZone() < 0) return; auto scaleFactor = qGuiApp->devicePixelRatio(); auto *x11Application = qGuiApp->nativeInterface(); diff --git a/panels/dock/dockhelper.cpp b/panels/dock/dockhelper.cpp index 2742ef06f..67d0a16b7 100644 --- a/panels/dock/dockhelper.cpp +++ b/panels/dock/dockhelper.cpp @@ -96,9 +96,24 @@ bool DockHelper::eventFilter(QObject *watched, QEvent *event) m_hideTimer->start(); break; } - + case QEvent::Show: { + // if the dock's subwindow is show, the dock is not hidden + if (window->transientParent() != NULL && + topTransientParent == parent()->rootObject()) { + m_transientChildShows.insert(window, true); + if (m_hideTimer->isActive()) { + m_hideTimer->stop(); + } + } + break; + } case QEvent::Hide: { m_enters.remove(window); + if (window->transientParent() != NULL && + topTransientParent == parent()->rootObject()) { + m_transientChildShows.remove(window); + m_hideTimer->start(); + } break; } default: { @@ -184,6 +199,10 @@ void DockHelper::checkNeedHideOrNot() needHide &= !enter; } + for (auto show : m_transientChildShows) { + needHide &= !show; + } + if (needHide) parent()->setHideState(Hide); } diff --git a/panels/dock/dockhelper.h b/panels/dock/dockhelper.h index f1019de0b..843341f46 100644 --- a/panels/dock/dockhelper.h +++ b/panels/dock/dockhelper.h @@ -49,6 +49,7 @@ private Q_SLOTS: private: QHash m_areas; QHash m_enters; + QHash m_transientChildShows; QTimer *m_hideTimer; QTimer *m_showTimer; };