1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 17:33:50 +03:00

if mode is DodgeMaximized, only dodge active window

This commit is contained in:
Johan Smith Agudelo Rodriguez 2016-12-30 02:45:38 -05:00
parent c022ed38c4
commit 0abb5ab83e

View File

@ -21,6 +21,8 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
connect(&timerCheckWindows, &QTimer::timeout, this, &VisibilityManagerPrivate::checkAllWindows);
connect(&timerShow, &QTimer::timeout, q, &VisibilityManager::mustBeShown);
connect(&timerHide, &QTimer::timeout, q, &VisibilityManager::mustBeHide);
wm->setDockDefaultFlags();
}
VisibilityManagerPrivate::~VisibilityManagerPrivate()
@ -169,15 +171,15 @@ void VisibilityManagerPrivate::dodgeActive(WId wid)
void VisibilityManagerPrivate::dodgeMaximized(WId wid)
{
if (wid != wm->activeWindow())
return;
auto winfo = wm->requestInfo(wid);
if (!winfo.isValid() || !winfo.isOnCurrentDesktop() || winfo.isMinimized())
return;
if (winfo.isMaximized())
raiseDock(false);
else
timerCheckWindows.start();
raiseDock(winfo.isMaximized());
}
void VisibilityManagerPrivate::dodgeWindows(WId wid)
@ -209,11 +211,6 @@ void VisibilityManagerPrivate::checkAllWindows()
} else if (std::get<1>(winfo).isMinimized()) {
continue;
} else if (mode == Dock::DodgeMaximized) {
if (std::get<1>(winfo).isMaximized())
raise = false;
continue;
} else if (intersects(std::get<1>(winfo))) {
raise = false;
break;
@ -269,6 +266,9 @@ bool VisibilityManagerPrivate::event(QEvent *ev)
if (mode == Dock::AutoHide)
raiseDock(false);
} else if (ev->type() == QEvent::Show) {
wm->setDockDefaultFlags();
}
return QObject::event(ev);