mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-30 14:50:12 +03:00
DodgeMaximized receives some of love
DodgeMaximized now also dodges windows with a size greater than or equal to the screen
This commit is contained in:
parent
6bbce90628
commit
10d7ffa535
@ -60,6 +60,7 @@ VisibilityManagerPrivate::VisibilityManagerPrivate(PlasmaQuick::ContainmentView
|
||||
wm->setDockExtraFlags(*view);
|
||||
wm->addDock(view->winId());
|
||||
restoreConfig();
|
||||
|
||||
}
|
||||
|
||||
VisibilityManagerPrivate::~VisibilityManagerPrivate()
|
||||
@ -355,9 +356,19 @@ void VisibilityManagerPrivate::dodgeMaximized(WId wid)
|
||||
winfo = wm->requestInfo(wm->activeWindow());
|
||||
}
|
||||
|
||||
auto isMaxVert = [&]() noexcept -> bool {
|
||||
return winfo.isMaxVert()
|
||||
|| (view->screen() && view->screen()->size().height() <= winfo.geometry().height());
|
||||
};
|
||||
|
||||
auto isMaxHoriz = [&]() noexcept -> bool {
|
||||
return winfo.isMaxHoriz()
|
||||
|| (view->screen() && view->screen()->size().width() <= winfo.geometry().width());
|
||||
};
|
||||
|
||||
if (wm->isOnCurrentDesktop(wid) && !winfo.isMinimized())
|
||||
raiseDock(!(view->formFactor() == Plasma::Types::Vertical
|
||||
? winfo.isMaxHoriz() : winfo.isMaxVert()));
|
||||
raiseDock(view->formFactor() == Plasma::Types::Vertical
|
||||
? !isMaxHoriz() : !isMaxVert());
|
||||
}
|
||||
|
||||
void VisibilityManagerPrivate::dodgeWindows(WId wid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user