Add set_accomodate_exclusive_zones call

Add a new method that tells the surface whether to accomodate
exclusive zones set by other surfaces or not.
right until now this was possible by setting the eclusive zone of
this surface to the value of -1.
Besides being a magic number, it makes impossible for this surface to
set an exclusive zone by itself if we want to ignore other exclusive zones
This commit is contained in:
Marco Martin
2024-05-02 15:28:00 +02:00
parent b37ac92e9f
commit b40888ac2a
6 changed files with 48 additions and 3 deletions

View File

@ -56,6 +56,11 @@ QWaylandLayerSurface::QWaylandLayerSurface(QWaylandLayerShellIntegration *shell,
setExclusiveEdge(m_interface->exclusiveEdge());
});
setAccomodateExclusiveZones(m_interface->accomodateExclusiveZones());
connect(m_interface, &Window::accomodateExclusiveZonesChanged, this, [this]() {
setAccomodateExclusiveZones(m_interface->accomodateExclusiveZones());
});
setMargins(m_interface->margins());
connect(m_interface, &Window::marginsChanged, this, [this]() {
setMargins(m_interface->margins());
@ -151,6 +156,13 @@ void QWaylandLayerSurface::setExclusiveEdge(uint32_t edge)
}
}
void QWaylandLayerSurface::setAccomodateExclusiveZones(bool accomodate)
{
if (zwlr_layer_surface_v1_get_version(object()) >= ZWLR_LAYER_SURFACE_V1_SET_ACCOMODATE_EXCLUSIVE_ZONES_SINCE_VERSION) {
set_accomodate_exclusive_zones(accomodate);
}
}
void QWaylandLayerSurface::setMargins(const QMargins &margins)
{
set_margin(margins.top(), margins.right(), margins.bottom(), margins.left());