show view immediately for DragEnter

--when the user had activated KWin Edges and the
Show Timer was too high when the View delayed a
lot to show for DragEnter events
pull/7/head
Michail Vourlakos
parent b5c954bf99
commit 9e9003870b

@ -267,7 +267,12 @@ void ScreenEdgeGhostWindow::setContainsMouse(bool contains)
bool ScreenEdgeGhostWindow::event(QEvent *e) bool ScreenEdgeGhostWindow::event(QEvent *e)
{ {
if (e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) { if (e->type() == QEvent::DragEnter) {
m_delayedContainsMouse = false;
m_delayedMouseTimer.stop();
setContainsMouse(true);
emit dragEntered();
} else if (e->type() == QEvent::Enter || e->type() == QEvent::DragEnter) {
m_delayedContainsMouse = true; m_delayedContainsMouse = true;
if (!m_delayedMouseTimer.isActive()) { if (!m_delayedMouseTimer.isActive()) {
m_delayedMouseTimer.start(); m_delayedMouseTimer.start();

@ -76,6 +76,7 @@ public:
signals: signals:
void containsMouseChanged(bool contains); void containsMouseChanged(bool contains);
void dragEntered();
protected: protected:
bool event(QEvent *ev) override; bool event(QEvent *ev) override;

@ -408,7 +408,7 @@ void VisibilityManager::updateGhostWindowState()
&& m_latteView->layout()->name() == m_corona->layoutsManager()->currentLayoutName())); && m_latteView->layout()->name() == m_corona->layoutsManager()->currentLayoutName()));
if (inCurrentLayout) { if (inCurrentLayout) {
m_wm->setEdgeStateFor(m_edgeGhostWindow, m_isHidden); m_wm->setEdgeStateFor(m_edgeGhostWindow, m_isHidden && !m_dragEnter);
} else { } else {
m_wm->setEdgeStateFor(m_edgeGhostWindow, false); m_wm->setEdgeStateFor(m_edgeGhostWindow, false);
} }
@ -647,14 +647,16 @@ void VisibilityManager::viewEventManager(QEvent *ev)
break; break;
case QEvent::Leave: case QEvent::Leave:
m_dragEnter = false;
setContainsMouse(false); setContainsMouse(false);
break; break;
case QEvent::DragEnter: case QEvent::DragEnter:
m_dragEnter = true; m_dragEnter = true;
if (m_isHidden) if (m_isHidden) {
emit mustBeShown(); emit mustBeShown();
}
break; break;
@ -722,6 +724,12 @@ void VisibilityManager::createEdgeGhostWindow()
} }
}); });
connect(m_edgeGhostWindow, &ScreenEdgeGhostWindow::dragEntered, this, [&]() {
if (m_isHidden) {
emit mustBeShown();
}
});
m_connectionsKWinEdges[0] = connect(m_wm, &WindowSystem::AbstractWindowInterface::currentActivityChanged, m_connectionsKWinEdges[0] = connect(m_wm, &WindowSystem::AbstractWindowInterface::currentActivityChanged,
this, [&]() { this, [&]() {
bool inCurrentLayout = (m_corona->layoutsManager()->memoryUsage() == Types::SingleLayout || bool inCurrentLayout = (m_corona->layoutsManager()->memoryUsage() == Types::SingleLayout ||

Loading…
Cancel
Save