From d5344f463f307b83ece82c107fbffa70c4ae0e58 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 25 Feb 2024 18:50:38 -0800 Subject: [PATCH] feat(panel): set exclusionMode to Normal when exclusiveZone is set --- src/core/panelinterface.hpp | 1 + src/wayland/waylandlayershell.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/panelinterface.hpp b/src/core/panelinterface.hpp index 2a2570b0..626fcb01 100644 --- a/src/core/panelinterface.hpp +++ b/src/core/panelinterface.hpp @@ -108,6 +108,7 @@ class PanelWindowInterface: public WindowInterface { /// > [!INFO] Only applies to edges with anchors Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged); /// The amount of space reserved for the shell layer relative to its anchors. + /// Setting this property sets `exclusionMode` to `Normal`. /// /// > [!INFO] Either 1 or 3 anchors are required for the zone to take effect. Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged); diff --git a/src/wayland/waylandlayershell.cpp b/src/wayland/waylandlayershell.cpp index 660b720a..4e4f7a58 100644 --- a/src/wayland/waylandlayershell.cpp +++ b/src/wayland/waylandlayershell.cpp @@ -115,16 +115,16 @@ qint32 WaylandLayershell::exclusiveZone() const { return this->ext->exclusiveZon void WaylandLayershell::setExclusiveZone(qint32 exclusiveZone) { this->mExclusiveZone = exclusiveZone; - - if (this->mExclusionMode == ExclusionMode::Normal) { - this->ext->setExclusiveZone(exclusiveZone); - } + this->setExclusionMode(ExclusionMode::Normal); + this->ext->setExclusiveZone(exclusiveZone); } ExclusionMode::Enum WaylandLayershell::exclusionMode() const { return this->mExclusionMode; } void WaylandLayershell::setExclusionMode(ExclusionMode::Enum exclusionMode) { this->mExclusionMode = exclusionMode; + if (exclusionMode == this->mExclusionMode) return; + if (exclusionMode == ExclusionMode::Normal) { this->ext->setExclusiveZone(this->mExclusiveZone); } else if (exclusionMode == ExclusionMode::Ignore) {