Skip to content

Commit be4e8fe

Browse files
xionglinlindeepin-bot[bot]
authored andcommitted
fix: Error with SmartHidden and KeepHidden modes of dock
1. SmartHide mode does not automatically hide 2. KeepHidden mode should not be hidden when a subwindow show Log: pms-302819
1 parent 8c900f1 commit be4e8fe

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

frame/layershell/x11dlayershellemulation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ void LayerShellEmulation::onPositionChanged()
151151
void LayerShellEmulation::onExclusionZoneChanged()
152152
{
153153
// dde-shell issues:379
154-
if (m_dlayerShellWindow->exclusionZone() <= 0)
154+
if (m_dlayerShellWindow->exclusionZone() < 0)
155155
return;
156156
auto scaleFactor = qGuiApp->devicePixelRatio();
157157
auto *x11Application = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();

panels/dock/dockhelper.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,24 @@ bool DockHelper::eventFilter(QObject *watched, QEvent *event)
9696
m_hideTimer->start();
9797
break;
9898
}
99-
99+
case QEvent::Show: {
100+
// if the dock's subwindow is show, the dock is not hidden
101+
if (window->transientParent() != NULL &&
102+
topTransientParent == parent()->rootObject()) {
103+
m_transientChildShows.insert(window, true);
104+
if (m_hideTimer->isActive()) {
105+
m_hideTimer->stop();
106+
}
107+
}
108+
break;
109+
}
100110
case QEvent::Hide: {
101111
m_enters.remove(window);
112+
if (window->transientParent() != NULL &&
113+
topTransientParent == parent()->rootObject()) {
114+
m_transientChildShows.remove(window);
115+
m_hideTimer->start();
116+
}
102117
break;
103118
}
104119
default: {
@@ -184,6 +199,10 @@ void DockHelper::checkNeedHideOrNot()
184199
needHide &= !enter;
185200
}
186201

202+
for (auto show : m_transientChildShows) {
203+
needHide &= !show;
204+
}
205+
187206
if (needHide)
188207
parent()->setHideState(Hide);
189208
}

panels/dock/dockhelper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ private Q_SLOTS:
4949
private:
5050
QHash<QScreen *, DockWakeUpArea *> m_areas;
5151
QHash<QWindow *, bool> m_enters;
52+
QHash<QWindow *, bool> m_transientChildShows;
5253
QTimer *m_hideTimer;
5354
QTimer *m_showTimer;
5455
};

0 commit comments

Comments
 (0)