From 402147fa7af877224c1ee19c212ef4bd8508a0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Mon, 11 Sep 2017 20:45:31 +0200 Subject: [PATCH] Fix broken startup The workspace init loop doesn't like that workspaces aren't fully initialized when running add_all_from_workspaces(workspace). (not sure why, since we really should only be referencing workspaces[workspace.workspace_index] which is initialized above the call. --- tiling.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tiling.js b/tiling.js index e0ede33..ac60db2 100644 --- a/tiling.js +++ b/tiling.js @@ -44,7 +44,9 @@ function log() { workspaces = [] -workspaces[0] = [] +for (let i=0; i < global.screen.n_workspaces; i++) { + workspaces[i] = [] +} focus = () => { let meta_window = global.display.focus_window; if (!meta_window) @@ -248,7 +250,6 @@ dynamic_function_ref = (handler_name, owner_obj) => { } for (let i=0; i < global.screen.n_workspaces; i++) { - workspaces[i] = [] let workspace = global.screen.get_workspace_by_index(i) print("workspace: " + workspace) workspace.connect("window-added", dynamic_function_ref("add_handler"))