From 9a10cd1e26e39343355d0b4f38e5641a67a0d8d6 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Tue, 16 Jul 2019 14:06:26 +0300 Subject: [PATCH] fix SharedLayout VisibilityManager::isCurrent state --when KWin edges are used in a SharedLayout then the all view Layout::isCurrent() function must be used otherwise the layout is not identified properly as current based on different layouts per activities --- app/view/screenedgeghostwindow.cpp | 9 ++++----- app/view/view.cpp | 1 + app/view/visibilitymanager.cpp | 9 +++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/view/screenedgeghostwindow.cpp b/app/view/screenedgeghostwindow.cpp index f3bb62933..1dbc6e34c 100644 --- a/app/view/screenedgeghostwindow.cpp +++ b/app/view/screenedgeghostwindow.cpp @@ -187,12 +187,11 @@ KWayland::Client::PlasmaShellSurface *ScreenEdgeGhostWindow::surface() void ScreenEdgeGhostWindow::updateGeometry() { QRect newGeometry; - int thickness; + int thickness{2}; + if (KWindowSystem::compositingActive()) { - thickness == 6; - } else { - thickness == 2; - }; + thickness = 6; + } if (m_latteView->location() == Plasma::Types::BottomEdge) { newGeometry.setX(m_latteView->absoluteGeometry().left()); diff --git a/app/view/view.cpp b/app/view/view.cpp index 346be6dba..4e31f5b7f 100644 --- a/app/view/view.cpp +++ b/app/view/view.cpp @@ -77,6 +77,7 @@ View::View(Plasma::Corona *corona, QScreen *targetScreen, bool byPassWM) setIcon(qGuiApp->windowIcon()); setResizeMode(QuickViewSharedEngine::SizeRootObjectToView); setColor(QColor(Qt::transparent)); + setDefaultAlphaBuffer(true); setClearBeforeRendering(true); const auto flags = Qt::FramelessWindowHint diff --git a/app/view/visibilitymanager.cpp b/app/view/visibilitymanager.cpp index 7af00d6c4..7e9b41b60 100644 --- a/app/view/visibilitymanager.cpp +++ b/app/view/visibilitymanager.cpp @@ -56,6 +56,9 @@ VisibilityManager::VisibilityManager(PlasmaQuick::ContainmentView *view) connect(this, &VisibilityManager::slideInFinished, this, &VisibilityManager::updateHiddenState); connect(this, &VisibilityManager::slideOutFinished, this, &VisibilityManager::updateHiddenState); + connect(this, &VisibilityManager::enableKWinEdgesChanged, this, &VisibilityManager::updateKWinEdgesSupport); + connect(this, &VisibilityManager::modeChanged, this, &VisibilityManager::updateKWinEdgesSupport); + if (m_latteView) { connect(m_latteView, &Latte::View::eventTriggered, this, &VisibilityManager::viewEventManager); connect(m_latteView, &Latte::View::byPassWMChanged, this, &VisibilityManager::updateKWinEdgesSupport); @@ -405,7 +408,7 @@ void VisibilityManager::updateGhostWindowState() bool inCurrentLayout = (m_corona->layoutsManager()->memoryUsage() == Types::SingleLayout || (m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts && m_latteView->layout() && !m_latteView->positioner()->inLocationChangeAnimation() - && m_latteView->layout()->name() == m_corona->layoutsManager()->currentLayoutName())); + && m_latteView->layout()->isCurrent())); if (inCurrentLayout) { m_wm->setEdgeStateFor(m_edgeGhostWindow, m_isHidden); @@ -686,8 +689,6 @@ void VisibilityManager::setEnableKWinEdges(bool enable) m_enableKWinEdgesFromUser = enable; emit enableKWinEdgesChanged(); - - updateKWinEdgesSupport(); } void VisibilityManager::updateKWinEdgesSupport() @@ -735,7 +736,7 @@ void VisibilityManager::createEdgeGhostWindow() bool inCurrentLayout = (m_corona->layoutsManager()->memoryUsage() == Types::SingleLayout || (m_corona->layoutsManager()->memoryUsage() == Types::MultipleLayouts && m_latteView->layout() && !m_latteView->positioner()->inLocationChangeAnimation() - && m_latteView->layout()->name() == m_corona->layoutsManager()->currentLayoutName())); + && m_latteView->layout()->isCurrent())); if (m_edgeGhostWindow) { if (inCurrentLayout) {