From efbd2a8276c15ab858813d2ba801ef8c250c74dc Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 2 Jan 2020 18:40:44 +0200 Subject: [PATCH] floating:staying mouse on edge and not hiding --when the floating view is a real panel window and slides out-in with real animation if the user keeps its mouse on the screen edge the view can remain shown without sliding out --- app/view/screenedgeghostwindow.cpp | 4 ++++ app/view/visibilitymanager.cpp | 14 +++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/view/screenedgeghostwindow.cpp b/app/view/screenedgeghostwindow.cpp index b8729e653..48300dbef 100644 --- a/app/view/screenedgeghostwindow.cpp +++ b/app/view/screenedgeghostwindow.cpp @@ -186,6 +186,10 @@ KWayland::Client::PlasmaShellSurface *ScreenEdgeGhostWindow::surface() void ScreenEdgeGhostWindow::updateGeometry() { + if (m_latteView->positioner()->slideOffset() != 0) { + return; + } + QRect newGeometry; int thickness{2}; diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index db1688434..5428212b6 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -396,9 +396,7 @@ void VisibilityManager::setIsHidden(bool isHidden) m_isHidden = isHidden; - if (!m_latteView->behaveAsPlasmaPanel()) { - updateGhostWindowState(); - } + updateGhostWindowState(); emit isHiddenChanged(); } @@ -479,7 +477,13 @@ void VisibilityManager::updateGhostWindowState() if (m_mode == Latte::Types::WindowsCanCover) { m_wm->setEdgeStateFor(m_edgeGhostWindow, m_isBelowLayer && !m_containsMouse); } else { - m_wm->setEdgeStateFor(m_edgeGhostWindow, m_isHidden && !m_containsMouse); + bool viewIsFloatingAndMouseOnEdge = + m_latteView->behaveAsPlasmaPanel() + && m_latteView->screenEdgeMarginEnabled() + && m_latteView->screenEdgeMargin()>0 + && m_edgeGhostWindow->containsMouse(); + + m_wm->setEdgeStateFor(m_edgeGhostWindow, (m_isHidden && !m_containsMouse) || viewIsFloatingAndMouseOnEdge); } } else { m_wm->setEdgeStateFor(m_edgeGhostWindow, false); @@ -552,7 +556,7 @@ void VisibilityManager::updateHiddenState() switch (m_mode) { case Types::AutoHide: case Types::WindowsCanCover: - raiseView(m_containsMouse); + raiseView(m_containsMouse || (m_edgeGhostWindow && m_edgeGhostWindow->containsMouse())); break; case Types::DodgeActive: