mirror of
https://github.com/tuxdotrs/tpanel.git
synced 2025-10-10 21:01:54 +05:30
fix: crashing when no focused client is available
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { createBinding, createComputed } from "ags";
|
import { createBinding, createComputed, With } from "ags";
|
||||||
import { Gdk, Gtk } from "ags/gtk4";
|
import { Gdk, Gtk } from "ags/gtk4";
|
||||||
import AstalHyprland from "gi://AstalHyprland";
|
import AstalHyprland from "gi://AstalHyprland";
|
||||||
|
|
||||||
@@ -48,8 +48,10 @@ export const FocusedClient = () => {
|
|||||||
const focused = createBinding(hyprland, "focusedClient");
|
const focused = createBinding(hyprland, "focusedClient");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<box cssClasses={["focused-client"]} visible={focused.as(Boolean)}>
|
<box cssClasses={["focused-client"]}>
|
||||||
<label label={focused((client) => client.title)} />
|
<With value={focused}>
|
||||||
|
{(client) => client && <label label={createBinding(client, "title")} />}
|
||||||
|
</With>
|
||||||
</box>
|
</box>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user