From ed054062df30e9b384f2a6f3a05aefbd36d73d46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 12 May 2018 22:51:30 +0200 Subject: [PATCH] Use window_manager::switch-workspace instead of screen::workspace-switched The former happens earlier so is probably a better fit. --- tiling.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tiling.js b/tiling.js index 6cd43a4..62eee54 100644 --- a/tiling.js +++ b/tiling.js @@ -622,10 +622,11 @@ function enable() { color = 3; - global.screen[signals].push( - global.screen.connect( - 'workspace-switched', - (screen, fromIndex, toIndex) => { + global.window_manager[signals] = [ + global.window_manager.connect( + 'switch-workspace', + (wm, fromIndex, toIndex) => { + log('workpace-switched'); let to = screen.get_workspace_by_index(toIndex); let from = screen.get_workspace_by_index(fromIndex); let toSpace = spaces.spaceOf(to); @@ -661,8 +662,8 @@ function enable() { continue; monitor.clickOverlay.activate(); } - })); - + }) + ]; // HACK: couldn't find an other way within a reasonable time budget // This state is different from being enabled after startup. Existing // windows are not accessible yet for instance. @@ -711,8 +712,7 @@ function disable () { }); // Disable workspace related signals - global.screen[signals].forEach(id => global.screen.disconnect(id)); - global.screen[signals] = []; + global.window_manager[signals].forEach(id => global.window_manager.disconnect(id)); } /**