Skip to content

Commit 1673b9f

Browse files
committed
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 bfdb105 commit 1673b9f

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
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: 24 additions & 5 deletions
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_subWindowShows.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_subWindowShows.remove(window);
115+
m_hideTimer->start();
116+
}
102117
break;
103118
}
104119
default: {
@@ -180,10 +195,14 @@ void DockHelper::checkNeedHideOrNot()
180195
}
181196

182197
// any enter will not make hide
183-
for (auto enter : m_enters) {
184-
needHide &= !enter;
198+
for (auto flag : m_enters) {
199+
needHide &= !flag;
185200
}
186201

202+
for (auto show : m_subWindowShows) {
203+
needHide &= !show;
204+
}
205+
187206
if (needHide)
188207
parent()->setHideState(Hide);
189208
}
@@ -209,8 +228,8 @@ void DockHelper::checkNeedShowOrNot()
209228
}
210229
}
211230

212-
for (auto enter : m_enters) {
213-
needShow |= enter;
231+
for (auto flag : m_enters) {
232+
needShow |= flag;
214233
}
215234

216235
if (needShow)

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_subWindowShows;
5253
QTimer *m_hideTimer;
5354
QTimer *m_showTimer;
5455
};

0 commit comments

Comments
 (0)