[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
wilder-5.14
Martin Gräßlin 10 years ago
parent 25e76917d1
commit f0300cec3c
  1. 27
      shell/panelview.cpp
  2. 1
      shell/panelview.h

@ -316,12 +316,39 @@ void PanelView::setVisibilityMode(PanelView::VisibilityMode mode)
m_corona->requestApplicationConfigSync(); m_corona->requestApplicationConfigSync();
} }
visibilityModeToWayland();
updateStruts(); updateStruts();
emit visibilityModeChanged(); emit visibilityModeChanged();
restoreAutoHide(); 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 PanelView::VisibilityMode PanelView::visibilityMode() const
{ {
return m_visibilityMode; return m_visibilityMode;

@ -198,6 +198,7 @@ private:
bool containmentContainsPosition(const QPointF &point) const; bool containmentContainsPosition(const QPointF &point) const;
QPointF positionAdjustedForContainment(const QPointF &point) const; QPointF positionAdjustedForContainment(const QPointF &point) const;
void setupWaylandIntegration(); void setupWaylandIntegration();
void visibilityModeToWayland();
bool edgeActivated() const; bool edgeActivated() const;
void updateEnabledBorders(); void updateEnabledBorders();
bool canSetStrut() const; bool canSetStrut() const;

Loading…
Cancel
Save