From 047ec64287a5fb49602ca3e620ea36916651fbae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Sat, 19 Oct 2019 19:21:33 +0200 Subject: [PATCH] Space: record which space a window is tiled --- tiling.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index f1cb860..fed45fc 100644 --- a/tiling.js +++ b/tiling.js @@ -564,6 +564,8 @@ class Space extends Array { if (this.indexOf(metaWindow) !== -1) return false; + metaWindow._workspace = this.workspace; + if (row !== undefined && this[index]) { let column = this[index]; column.splice(row, 0, metaWindow); @@ -588,6 +590,7 @@ class Space extends Array { let index = this.indexOf(metaWindow); if (index === -1) return this.removeFloating(metaWindow); + metaWindow._workspace = null; let selected = this.selectedWindow; if (selected === metaWindow) { @@ -762,6 +765,10 @@ class Space extends Array { return -1; } + includes(metaWindow) { + return metaWindow._workspace === this.workspace; + } + rowOf(metaWindow) { let column = this[this.indexOf(metaWindow)]; return column.indexOf(metaWindow); @@ -1746,7 +1753,10 @@ class Spaces extends Map { }; spaceOfWindow(meta_window) { - return this.get(meta_window.get_workspace()); + let workspace = meta_window._workspace; + if (!workspace) + workspace = meta_window.get_workspace(); + return this.get(workspace); }; spaceOf(workspace) {