From 91ff26882ea9e4d616c5c479d2f47efbf427dad2 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 5 Dec 2017 20:56:58 +0200 Subject: [PATCH] fix #784,ignore top/bottom auto-hide panels --a bottom or top auto-hide panel is not considered in the calculations for the availableScreenRegion --- app/dockcorona.cpp | 3 ++- app/visibilitymanager.cpp | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/app/dockcorona.cpp b/app/dockcorona.cpp index d29c96aea..e689e7129 100644 --- a/app/dockcorona.cpp +++ b/app/dockcorona.cpp @@ -357,7 +357,8 @@ QRegion DockCorona::availableScreenRegion(int id) const QRegion available(screen->geometry()); for (const auto *view : m_dockViews) { - if (view && view->containment() && view->screen() == screen) { + if (view && view->containment() && view->screen() == screen + && view->visibility() && (view->visibility()->mode() != Latte::Dock::AutoHide)) { int realThickness = view->normalThickness() - view->shadow(); // Usually availableScreenRect is used by the desktop, diff --git a/app/visibilitymanager.cpp b/app/visibilitymanager.cpp index 02b51a1cd..6c8485c0b 100644 --- a/app/visibilitymanager.cpp +++ b/app/visibilitymanager.cpp @@ -562,6 +562,11 @@ void VisibilityManagerPrivate::viewEventManager(QEvent *ev) VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) : d(new VisibilityManagerPrivate(view, this)) { + DockView *dockView = qobject_cast(view); + + if (dockView) { + connect(this, &VisibilityManager::modeChanged, dockView->corona(), &Plasma::Corona::availableScreenRectChanged); + } } VisibilityManager::~VisibilityManager()