1
0
mirror of https://github.com/KDE/latte-dock.git synced 2025-03-24 02:50:35 +03:00

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
This commit is contained in:
Michail Vourlakos 2020-01-02 18:40:44 +02:00
parent dba2f3bc8b
commit efbd2a8276
2 changed files with 13 additions and 5 deletions

View File

@ -186,6 +186,10 @@ KWayland::Client::PlasmaShellSurface *ScreenEdgeGhostWindow::surface()
void ScreenEdgeGhostWindow::updateGeometry()
{
if (m_latteView->positioner()->slideOffset() != 0) {
return;
}
QRect newGeometry;
int thickness{2};

View File

@ -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: