forked from quickshell/quickshell
wayland/layershell: ensure exclusive zone is updated on zone/mode chg
This commit is contained in:
parent
644254d9ec
commit
edfc4c681c
2 changed files with 15 additions and 16 deletions
|
@ -14,7 +14,20 @@
|
|||
|
||||
namespace qs::wayland::layershell {
|
||||
|
||||
WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) {}
|
||||
WlrLayershell::WlrLayershell(QObject* parent): ProxyWindowBase(parent) {
|
||||
this->bcExclusiveZone.setBinding([this]() -> qint32 {
|
||||
switch (this->bExclusionMode.value()) {
|
||||
case ExclusionMode::Ignore: return -1;
|
||||
case ExclusionMode::Normal: return this->bExclusiveZone;
|
||||
case ExclusionMode::Auto:
|
||||
const auto anchors = this->bAnchors.value();
|
||||
|
||||
if (anchors.horizontalConstraint()) return this->height();
|
||||
else if (anchors.verticalConstraint()) return this->width();
|
||||
else return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ProxiedWindow* WlrLayershell::retrieveWindow(QObject* oldInstance) {
|
||||
auto* old = qobject_cast<WlrLayershell*>(oldInstance);
|
||||
|
@ -112,19 +125,6 @@ LayerSurfaceState WlrLayershell::computeState() const {
|
|||
};
|
||||
}
|
||||
|
||||
qint32 WlrLayershell::computeExclusiveZone() const {
|
||||
switch (this->bExclusionMode.value()) {
|
||||
case ExclusionMode::Ignore: return -1;
|
||||
case ExclusionMode::Normal: return this->bExclusiveZone;
|
||||
case ExclusionMode::Auto:
|
||||
const auto anchors = this->bAnchors.value();
|
||||
|
||||
if (anchors.horizontalConstraint()) return this->height();
|
||||
else if (anchors.verticalConstraint()) return this->width();
|
||||
else return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void WlrLayershell::updateAutoExclusion() { this->bcExclusiveZone.notify(); }
|
||||
|
||||
WlrLayershell* WlrLayershell::qmlAttachedProperties(QObject* object) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue