Share the workspace stack between monitors

We move and scale the `space.clip`s to the active monitor. If we select a
workspace which came from another monitor we move it fully to the active monitor
with `space.setMonitor`.
This commit is contained in:
Tor Hedin Brønner
2018-04-30 00:03:08 +02:00
parent b3a395c051
commit 870720e44d
2 changed files with 20 additions and 1 deletions
+19 -1
View File
@@ -42,6 +42,7 @@ var PreviewedWindowNavigator = new Lang.Class({
this.multimap = multimap;
this._switcherList = multimap;
this.space = this._switcherList.getSelected().space;
this.monitor = this.space.monitor;
this._switcherList.onlyShowSelected();
@@ -101,14 +102,29 @@ var PreviewedWindowNavigator = new Lang.Class({
let multimap = this.multimap;
Meta.disable_unredirect_for_screen(global.screen);
let visible = Main.layoutManager.monitors
.map(m => Tiling.spaces.monitors.get(m));
let top = multimap.minimaps[0];
multimap.minimaps = [top].concat(multimap.minimaps
.filter(m => visible.indexOf(m.space) === -1));
if (move && !Scratch.isScratchActive()) {
this._moving = this.space.selectedWindow;
Scratch.makeScratch(this._moving);
}
let monitor = this.monitor;
let cloneParent = this.space.clip.get_parent();
multimap.minimaps.forEach((m, i) => {
multimap.minimaps .forEach((m, i) => {
let space = m.space;
space.clip.set_position(monitor.x, monitor.y);
let scaleX = monitor.width/space.width;
let scaleY = monitor.height/space.height;
space.clip.set_scale(scaleX, scaleY);
let h = heights[i];
if (h === undefined)
h = heights[heights.length-1];
@@ -326,6 +342,8 @@ var PreviewedWindowNavigator = new Lang.Class({
this.space.selectedWindow = from[this._startIndex];
}
this.space.setMonitor(this.monitor);
if (this.space === from && force) {
// We can't activate an already active workspace
switchWorkspace(this.space.workspace);
+1
View File
@@ -118,6 +118,7 @@ class Space extends Array {
this.height = monitor.height;
cloneContainer.set_scale(1, 1);
clip.set_scale(1, 1);
clip.set_position(monitor.x, monitor.y);
clip.set_size(monitor.width, monitor.height);