feat(ags): improve fullscreen bar hiding

This commit is contained in:
matt1432 2023-10-21 01:15:21 -04:00
parent 127974d0c2
commit f70762d388

View file

@ -8,11 +8,11 @@ import { RoundedCorner } from '../screen-corners.js';
import Gesture from './gesture.js'; import Gesture from './gesture.js';
// TODO: add fullscreen status in hyprland.ts Hyprland.connect('changed', () => {
// TODO: when fullscreen changes, keep current workspace in memory. Revealed.value = Hyprland.getWorkspace(Hyprland.active.workspace.id)
// if it changes while still in fullscreen, check directly .hasfullscreen;
// with hyprctl if in fullscreen or not until fullscreen });
// status changes again Hyprland.connect('fullscreen', (_, fullscreen) => Revealed.value = fullscreen);
export default props => Overlay({ export default props => Overlay({
overlays: [ overlays: [
@ -30,14 +30,7 @@ export default props => Overlay({
setup: self => self.revealChild = true, setup: self => self.revealChild = true,
properties: [['timeouts', []]], properties: [['timeouts', []]],
connections: [[Hyprland, self => { connections: [[Revealed, self => {
Utils.execAsync('hyprctl activewindow -j').then(out => {
const client = JSON.parse(out);
if (client.fullscreen === Revealed.value)
return;
Revealed.value = client.fullscreen;
if (Revealed.value) { if (Revealed.value) {
Utils.timeout(2000, () => { Utils.timeout(2000, () => {
if (Revealed.value) if (Revealed.value)
@ -47,7 +40,6 @@ export default props => Overlay({
else { else {
self.revealChild = true; self.revealChild = true;
} }
}).catch(print);
}]], }]],
child: Gesture({ child: Gesture({