diff --git a/app/view/screenedgeghostwindow.cpp b/app/view/screenedgeghostwindow.cpp index 1d2d30233..60f23e02e 100644 --- a/app/view/screenedgeghostwindow.cpp +++ b/app/view/screenedgeghostwindow.cpp @@ -135,7 +135,7 @@ KWayland::Client::PlasmaShellSurface *ScreenEdgeGhostWindow::surface() void ScreenEdgeGhostWindow::updateGeometry() { QRect newGeometry; - int thickness{1}; + int thickness{2}; if (m_latteView->location() == Plasma::Types::BottomEdge) { newGeometry.setX(m_latteView->absGeometry().left()); @@ -216,12 +216,27 @@ void ScreenEdgeGhostWindow::setupWaylandIntegration() } } +bool ScreenEdgeGhostWindow::containsMouse() const +{ + return m_containsMouse; +} + +void ScreenEdgeGhostWindow::setContainsMouse(bool contains) +{ + if (m_containsMouse == contains) { + return; + } + + m_containsMouse = contains; + emit containsMouseChanged(contains); +} + bool ScreenEdgeGhostWindow::event(QEvent *e) { if (e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) { - emit containsMouseChanged(true); + setContainsMouse(true); } else if (e->type() == QEvent::Leave || e->type() == QEvent::DragLeave) { - emit containsMouseChanged(false); + setContainsMouse(false); } return QQuickView::event(e); diff --git a/app/view/screenedgeghostwindow.h b/app/view/screenedgeghostwindow.h index a27a0777f..76df91a77 100644 --- a/app/view/screenedgeghostwindow.h +++ b/app/view/screenedgeghostwindow.h @@ -63,6 +63,8 @@ public: ScreenEdgeGhostWindow(Latte::View *view); ~ScreenEdgeGhostWindow() override; + bool containsMouse() const; + int location(); void hideWithMask(); @@ -84,9 +86,11 @@ private slots: void fixGeometry(); private: + void setContainsMouse(bool contains); void setupWaylandIntegration(); private: + bool m_containsMouse{false}; bool m_inDelete{false}; QRect m_calculatedGeometry; diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index de91eb9d4..3a1f8aa6f 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -298,18 +298,7 @@ void VisibilityManager::setIsHidden(bool isHidden) m_isHidden = isHidden; - if (supportsKWinEdges()) { - bool inCurrentLayout = (m_corona->layoutManager()->memoryUsage() == Types::SingleLayout || - (m_corona->layoutManager()->memoryUsage() == Types::MultipleLayouts - && m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation() - && m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName())); - - if (inCurrentLayout) { - wm->setEdgeStateFor(edgeGhostWindow, m_isHidden); - } else { - wm->setEdgeStateFor(edgeGhostWindow, false); - } - } + updateGhostWindowState(); emit isHiddenChanged(); } @@ -368,6 +357,22 @@ bool VisibilityManager::supportsKWinEdges() const return (edgeGhostWindow != nullptr); } +void VisibilityManager::updateGhostWindowState() +{ + if (supportsKWinEdges()) { + bool inCurrentLayout = (m_corona->layoutManager()->memoryUsage() == Types::SingleLayout || + (m_corona->layoutManager()->memoryUsage() == Types::MultipleLayouts + && m_latteView->managedLayout() && !m_latteView->positioner()->inLocationChangeAnimation() + && m_latteView->managedLayout()->name() == m_corona->layoutManager()->currentLayoutName())); + + if (inCurrentLayout) { + wm->setEdgeStateFor(edgeGhostWindow, m_isHidden); + } else { + wm->setEdgeStateFor(edgeGhostWindow, false); + } + } +} + void VisibilityManager::raiseView(bool raise) { if (m_blockHiding) @@ -721,7 +726,10 @@ void VisibilityManager::createEdgeGhostWindow() connect(edgeGhostWindow, &ScreenEdgeGhostWindow::containsMouseChanged, this, [ = ](bool contains) { if (contains) { - emit mustBeShown(); + raiseView(true); + } else { + m_timerShow.stop(); + updateGhostWindowState(); } }); diff --git a/app/view/visibilitymanager.h b/app/view/visibilitymanager.h index d2bba3310..35a4c834f 100644 --- a/app/view/visibilitymanager.h +++ b/app/view/visibilitymanager.h @@ -137,6 +137,7 @@ private: void createEdgeGhostWindow(); void deleteEdgeGhostWindow(); void updateKWinEdgesSupport(); + void updateGhostWindowState(); void setViewGeometry(const QRect &rect);