💥 fix(bar/focused-client): focused client is null after opening a new window on an empty workspace

AstalHyprland reports the focused client in a wrong way, so I decided to use a different way to get the focused client using colorshell's `Compositor` abstraction
This commit is contained in:
retrozinndev
2025-10-25 15:35:00 -03:00
parent 1478558bb6
commit 8e8ca30974
4 changed files with 88 additions and 60 deletions
+2 -6
View File
@@ -1,16 +1,12 @@
import { CompositorHyprland } from "../../../modules/compositors/hyprland";
import { Gtk } from "ags/gtk4";
import { createBinding, With } from "ags";
import { variableToBoolean } from "../../../modules/utils";
import { getAppIcon, getSymbolicIcon } from "../../../modules/apps";
import Pango from "gi://Pango?version=1.0";
import AstalHyprland from "gi://AstalHyprland";
const hyprland = AstalHyprland.get_default();
// Fix empty focused-client on opening a window on an empty workspace
hyprland.connect("notify::clients", () => hyprland.notify("focused-client"));
const hyprland = new CompositorHyprland;
export const FocusedClient = () => {
const focusedClient = createBinding(hyprland, "focusedClient");