Skip to content

Commit b207deb

Browse files
committed
overrides: Make MetaWindowActor.get_workspace always return an
index; Ref: #11165
1 parent ac47ff3 commit b207deb

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

js/ui/overrides.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,16 @@ function overrideMeta() {
140140
}
141141

142142
Meta.WindowActor.prototype.get_workspace = function() {
143-
return this.meta_window ? this.meta_window.get_workspace().workspace_index : 0;
143+
if (!this.meta_window) {
144+
return -1;
145+
}
146+
147+
const ws = this.meta_window.get_workspace();
148+
if (ws == null) {
149+
return -1;
150+
}
151+
152+
return ws.workspace_index;
144153
}
145154
}
146155

0 commit comments

Comments
 (0)