diff options
-rw-r--r-- | lib/sway/sway.vala | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/sway/sway.vala b/lib/sway/sway.vala index dd10824..2fa4c0e 100644 --- a/lib/sway/sway.vala +++ b/lib/sway/sway.vala @@ -14,13 +14,10 @@ namespace AstalSway { return _instance; } - var s = new Sway(); - var ipc = new Ipc(); + var s = new Sway(); try { - ipc.init(); - s.ipc = ipc; - s.subscribe.begin(); + s.init(); _instance = s; return s; } catch (Error err) { @@ -30,6 +27,12 @@ namespace AstalSway { } + private void init() throws Error { + ipc = new Ipc(); + ipc.init(); + subscribe.begin(() => sync_tree.begin()); + } + public Workspace focused_workspace; public Output focused_output; public Container? focused_container; |