feat(panel): set exclusionMode to Normal when exclusiveZone is set

This commit is contained in:
outfoxxed 2024-02-25 18:50:38 -08:00
parent 8cd9657f97
commit d5344f463f
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 5 additions and 4 deletions

View file

@ -108,6 +108,7 @@ class PanelWindowInterface: public WindowInterface {
/// > [!INFO] Only applies to edges with anchors /// > [!INFO] Only applies to edges with anchors
Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged); Q_PROPERTY(Margins margins READ margins WRITE setMargins NOTIFY marginsChanged);
/// The amount of space reserved for the shell layer relative to its anchors. /// 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. /// > [!INFO] Either 1 or 3 anchors are required for the zone to take effect.
Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged); Q_PROPERTY(qint32 exclusiveZone READ exclusiveZone WRITE setExclusiveZone NOTIFY exclusiveZoneChanged);

View file

@ -115,16 +115,16 @@ qint32 WaylandLayershell::exclusiveZone() const { return this->ext->exclusiveZon
void WaylandLayershell::setExclusiveZone(qint32 exclusiveZone) { void WaylandLayershell::setExclusiveZone(qint32 exclusiveZone) {
this->mExclusiveZone = exclusiveZone; this->mExclusiveZone = exclusiveZone;
this->setExclusionMode(ExclusionMode::Normal);
if (this->mExclusionMode == ExclusionMode::Normal) {
this->ext->setExclusiveZone(exclusiveZone); this->ext->setExclusiveZone(exclusiveZone);
}
} }
ExclusionMode::Enum WaylandLayershell::exclusionMode() const { return this->mExclusionMode; } ExclusionMode::Enum WaylandLayershell::exclusionMode() const { return this->mExclusionMode; }
void WaylandLayershell::setExclusionMode(ExclusionMode::Enum exclusionMode) { void WaylandLayershell::setExclusionMode(ExclusionMode::Enum exclusionMode) {
this->mExclusionMode = exclusionMode; this->mExclusionMode = exclusionMode;
if (exclusionMode == this->mExclusionMode) return;
if (exclusionMode == ExclusionMode::Normal) { if (exclusionMode == ExclusionMode::Normal) {
this->ext->setExclusiveZone(this->mExclusiveZone); this->ext->setExclusiveZone(this->mExclusiveZone);
} else if (exclusionMode == ExclusionMode::Ignore) { } else if (exclusionMode == ExclusionMode::Ignore) {