summaryrefslogtreecommitdiff
path: root/lib/sway/sway.vala
diff options
context:
space:
mode:
authornoname <[email protected]>2025-03-07 18:38:26 +1100
committernoname <[email protected]>2025-03-07 19:21:44 +1100
commitfa79458c7f79e22c59485e14c15ddac2ea3184ab (patch)
treea0257df9dce1ad5f7e684c3442ecb8c81d326e1b /lib/sway/sway.vala
parent6320e13ec8de2af18c09faa2a5c7978051e3b347 (diff)
fix startup
Diffstat (limited to 'lib/sway/sway.vala')
-rw-r--r--lib/sway/sway.vala14
1 files changed, 12 insertions, 2 deletions
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<string, Workspace>(str_hash, str_equal);