diff --git a/src/components/bar/layout/BarLayout.tsx b/src/components/bar/layout/BarLayout.tsx index 6e97ddfd0..a998de2c1 100644 --- a/src/components/bar/layout/BarLayout.tsx +++ b/src/components/bar/layout/BarLayout.tsx @@ -16,6 +16,7 @@ export class BarLayout { private _widgetRegistry: WidgetRegistry; private _visibilityVar: Variable; + private _exclusivityVar: Variable; private _classNameVar: Variable; private _anchorVar: Variable; private _layerVar: Variable; @@ -32,6 +33,7 @@ export class BarLayout { this._widgetRegistry = widgetRegistry; this._visibilityVar = Variable(true); + this._exclusivityVar = Variable(Astal.Exclusivity.EXCLUSIVE); this._classNameVar = Variable('bar'); this._anchorVar = Variable( Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT, @@ -79,9 +81,7 @@ export class BarLayout { visible={this._visibilityVar()} anchor={this._anchorVar()} layer={this._layerVar()} - exclusivity={bind(this._visibilityVar).as((visible) => - visible ? Astal.Exclusivity.EXCLUSIVE : Astal.Exclusivity.NORMAL, - )} + exclusivity={this._exclusivityVar()} onDestroy={() => this._cleanup()} > @@ -130,7 +130,7 @@ export class BarLayout { * Initialize variables related to bar positioning */ private _initializePositionVariables(): void { - const { location } = options.theme.bar; + const { location, exclusive } = options.theme.bar; this._anchorVar = Variable.derive([bind(location)], (loc) => { if (loc === 'bottom') { @@ -138,6 +138,9 @@ export class BarLayout { } return Astal.WindowAnchor.TOP | Astal.WindowAnchor.LEFT | Astal.WindowAnchor.RIGHT; }); + this._exclusivityVar = Variable.derive([bind(exclusive)], (isExclusive: boolean) => { + return isExclusive ? Astal.Exclusivity.EXCLUSIVE : Astal.Exclusivity.NORMAL; + }); } private _initializeAppearanceVariables(): void { diff --git a/src/components/settings/pages/config/bar/index.tsx b/src/components/settings/pages/config/bar/index.tsx index 8bba498e1..6f31aa3e1 100644 --- a/src/components/settings/pages/config/bar/index.tsx +++ b/src/components/settings/pages/config/bar/index.tsx @@ -29,6 +29,12 @@ export const BarSettings = (): JSX.Element => { type="enum" enums={['top', 'bottom']} /> +