1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-01-08 13:18:09 +03:00

do not allow struts when view is offscreen

This commit is contained in:
Michail Vourlakos 2021-12-13 23:01:21 +02:00
parent 62ed63daf1
commit 5e0feef0f6
3 changed files with 11 additions and 0 deletions

View File

@ -266,6 +266,11 @@ void Positioner::setInRelocationShowing(bool active)
}
}
bool Positioner::isOffScreen() const
{
return (m_validGeometry.x()<-500 || m_validGeometry.y()<-500);
}
int Positioner::currentScreenId() const
{
auto *latteCorona = qobject_cast<Latte::Corona *>(m_view->corona());

View File

@ -78,6 +78,8 @@ public:
bool isStickedOnBottomEdge() const;
void setIsStickedOnBottomEdge(bool sticked);
bool isOffScreen() const;
QRect canvasGeometry();
void setScreenToFollow(QScreen *scr, bool updateScreenId = true);

View File

@ -422,6 +422,10 @@ void VisibilityManager::updateStrutsBasedOnLayoutsAndActivities(bool forceUpdate
bool VisibilityManager::canSetStrut() const
{
if (m_latteView->positioner()->isOffScreen()) {
return false;
}
if (!KWindowSystem::isPlatformX11()) {
return true;
}