Space: record which space a window is tiled

This commit is contained in:
Tor Hedin Brønner
2019-10-19 19:21:33 +02:00
parent e75f3aac7f
commit 047ec64287

View File

@@ -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) {