From fa79458c7f79e22c59485e14c15ddac2ea3184ab Mon Sep 17 00:00:00 2001 From: noname Date: Fri, 7 Mar 2025 18:38:26 +1100 Subject: fix startup --- lib/sway/sway.vala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'lib/sway/sway.vala') diff --git a/lib/sway/sway.vala b/lib/sway/sway.vala index 8fdbb17..f6c20b4 100644 --- a/lib/sway/sway.vala +++ b/lib/sway/sway.vala @@ -29,7 +29,12 @@ public class Sway : Object { private void init() throws Error { ipc = new Ipc(); ipc.init(); - subscribe.begin(() => sync_tree.begin()); + subscribe.begin(); + sync_tree.begin(() => { + notify_property("outputs"); + notify_property("workspaces"); + notify_property("windows"); + }); } public Workspace focused_workspace; @@ -95,7 +100,12 @@ public class Sway : Object { } public async void sync_tree() { - yield Node.sync_tree(); + var str = yield message_async(MESSAGE_GET_TREE, ""); + var obj = Json.from_string(str).get_object(); + if (obj == null) { + return; + } + yield Node.sync_tree(obj); _nodes = Node._all_nodes; var new_workspaces = new HashTable(str_hash, str_equal); -- cgit v1.2.3