Don't check for pointer warping if we haven't changed monitors

This seems to make `switchWorkspace` animation a bit smoother.
This commit is contained in:
Tor Hedin Brønner
2018-04-30 17:18:45 +02:00
parent 24e8f5534c
commit bb22c4ed52
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -341,7 +341,8 @@ var PreviewedWindowNavigator = new Lang.Class({
this.space.selectedWindow = from[this._startIndex];
}
this.space.setMonitor(this.monitor, true);
if (this.monitor !== this.space.monitor)
this.space.setMonitor(this.monitor, true);
if (this.space === from && force) {
// We can't activate an already active workspace
+6 -1
View File
@@ -584,10 +584,15 @@ function enable() {
(screen, fromIndex, toIndex) => {
let to = screen.get_workspace_by_index(toIndex);
let from = screen.get_workspace_by_index(fromIndex);
Navigator.switchWorkspace(to, from);
let toSpace = spaces.spaceOf(to);
spaces.monitors.set(toSpace.monitor, toSpace);
Navigator.switchWorkspace(to, from);
let fromSpace = spaces.spaceOf(from);
if (toSpace.monitor === fromSpace.monitor)
return;
toSpace.monitor.clickOverlay.deactivate();
let display = Gdk.Display.get_default();