fix(ags fullscreen): close closer when loses focus
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
a2283e5d6a
commit
2a9ea9a4e9
1 changed files with 20 additions and 21 deletions
|
@ -42,6 +42,25 @@ export default ({ bar, transition, monitor = 0, ...rest }) => {
|
|||
BarVisible.setValue(!v.value.monitors.includes(monitor));
|
||||
});
|
||||
|
||||
const barCloser = Window({
|
||||
name: `bar-${monitor}-closer`,
|
||||
visible: false,
|
||||
monitor,
|
||||
anchor: ['top', 'bottom', 'left', 'right'],
|
||||
layer: 'overlay',
|
||||
|
||||
child: EventBox({
|
||||
on_hover: () => {
|
||||
barCloser.set_visible(false);
|
||||
BarVisible.setValue(false);
|
||||
},
|
||||
|
||||
child: Box({
|
||||
css: 'padding: 1px;',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
// Hide bar instantly when out of focus
|
||||
Hyprland.active.workspace.connect('changed', () => {
|
||||
const addr = FullscreenState.value.clientAddrs.get(monitor);
|
||||
|
@ -51,31 +70,11 @@ export default ({ bar, transition, monitor = 0, ...rest }) => {
|
|||
|
||||
if (client!.workspace.id !== Hyprland.active.workspace.id) {
|
||||
BarVisible.setValue(false);
|
||||
barCloser.visible = false;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const barCloser = Window({
|
||||
name: `bar-${monitor}-closer`,
|
||||
visible: false,
|
||||
monitor,
|
||||
anchor: ['top', 'bottom', 'left', 'right'],
|
||||
layer: 'overlay',
|
||||
|
||||
child: EventBox({
|
||||
on_hover: (self) => {
|
||||
const parent = self.get_parent();
|
||||
|
||||
parent?.set_visible(false);
|
||||
BarVisible.setValue(false);
|
||||
},
|
||||
|
||||
child: Box({
|
||||
css: 'padding: 1px;',
|
||||
}),
|
||||
}),
|
||||
});
|
||||
|
||||
const buffer = Box({
|
||||
css: 'min-height: 10px',
|
||||
visible: BarVisible.bind().as((v) => !v),
|
||||
|
|
Loading…
Reference in a new issue