From f0300cec3cbb5e2c3605d89a68a921ff2c90dd2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Thu, 15 Sep 2016 14:46:45 +0200 Subject: [PATCH] [shell] Pass the panel visibility mode to KWayland PanelBehavior Summary: The visibility mode needs to be passed to KWayland by mapping to the PanelBehavior. This is required to pass the correct hint to KWin to adjust the layering, etc. BUG: 368499 Reviewers: #plasma Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D2789 --- shell/panelview.cpp | 27 +++++++++++++++++++++++++++ shell/panelview.h | 1 + 2 files changed, 28 insertions(+) diff --git a/shell/panelview.cpp b/shell/panelview.cpp index 13cf79b6d..953e42c0a 100644 --- a/shell/panelview.cpp +++ b/shell/panelview.cpp @@ -316,12 +316,39 @@ void PanelView::setVisibilityMode(PanelView::VisibilityMode mode) m_corona->requestApplicationConfigSync(); } + visibilityModeToWayland(); updateStruts(); emit visibilityModeChanged(); restoreAutoHide(); } +void PanelView::visibilityModeToWayland() +{ + if (!m_shellSurface) { + return; + } + KWayland::Client::PlasmaShellSurface::PanelBehavior behavior; + switch (m_visibilityMode) { + case NormalPanel: + behavior = KWayland::Client::PlasmaShellSurface::PanelBehavior::AlwaysVisible; + break; + case AutoHide: + behavior = KWayland::Client::PlasmaShellSurface::PanelBehavior::AutoHide; + break; + case LetWindowsCover: + behavior = KWayland::Client::PlasmaShellSurface::PanelBehavior::WindowsCanCover; + break; + case WindowsGoBelow: + behavior = KWayland::Client::PlasmaShellSurface::PanelBehavior::WindowsGoBelow; + break; + default: + Q_UNREACHABLE(); + return; + } + m_shellSurface->setPanelBehavior(behavior); +} + PanelView::VisibilityMode PanelView::visibilityMode() const { return m_visibilityMode; diff --git a/shell/panelview.h b/shell/panelview.h index 11f50ff0c..36c414e10 100644 --- a/shell/panelview.h +++ b/shell/panelview.h @@ -198,6 +198,7 @@ private: bool containmentContainsPosition(const QPointF &point) const; QPointF positionAdjustedForContainment(const QPointF &point) const; void setupWaylandIntegration(); + void visibilityModeToWayland(); bool edgeActivated() const; void updateEnabledBorders(); bool canSetStrut() const;