Skip to content

Commit 413958b

Browse files
committed
Force expo to utilize the current monitor that the mouse is on
1 parent 1201332 commit 413958b

File tree

1 file changed

+24
-24
lines changed

1 file changed

+24
-24
lines changed

js/ui/expo.js

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -195,22 +195,22 @@ Expo.prototype = {
195195
// when it is next shown.
196196
this.hide();
197197

198-
let primary = Main.layoutManager.primaryMonitor;
198+
let current = Main.layoutManager.currentMonitor;
199199
let rtl = (St.Widget.get_default_direction () == St.TextDirection.RTL);
200200

201201
let contentY = 0;
202-
let contentHeight = primary.height;
202+
let contentHeight = current.height;
203203

204-
this._group.set_position(primary.x, primary.y);
205-
this._group.set_size(primary.width, primary.height);
204+
this._group.set_position(current.x, current.y);
205+
this._group.set_size(current.width, current.height);
206206

207207
this._gradient.set_position(0, 0);
208-
this._gradient.set_size(primary.width, primary.height);
208+
this._gradient.set_size(current.width, current.height);
209209

210210
this._coverPane.set_position(0, 0);
211-
this._coverPane.set_size(primary.width, contentHeight);
211+
this._coverPane.set_size(current.width, contentHeight);
212212

213-
let viewWidth = primary.width - this._spacing;
213+
let viewWidth = current.width - this._spacing;
214214
let viewHeight = contentHeight - 2 * this._spacing;
215215
let viewY = contentY + this._spacing;
216216
let viewX = rtl ? 0 : this._spacing;
@@ -224,34 +224,34 @@ Expo.prototype = {
224224
this._windowCloseArea.width = node.get_length('width');
225225

226226
this._expo.actor.set_position(0, 0);
227-
this._expo.actor.set_size((primary.width - buttonWidth), primary.height);
227+
this._expo.actor.set_size((current.width - buttonWidth), current.height);
228228

229-
let buttonY = (primary.height - buttonHeight) / 2;
229+
let buttonY = (current.height - buttonHeight) / 2;
230230

231-
this._addWorkspaceButton.set_position((primary.width - buttonWidth), buttonY);
232-
this._addWorkspaceButton.set_size(buttonWidth, buttonHeight);
231+
this._addWorkspaceButton.set_position((current.width - buttonWidth), buttonY);
232+
this._addWorkspaceButton.set_size(buttonWidth, buttonHeight);
233233
if (this._addWorkspaceButton.get_theme_node().get_background_image() == null)
234-
this._addWorkspaceButton.set_style('background-image: url("/usr/share/cinnamon/theme/add-workspace.png");');
234+
this._addWorkspaceButton.set_style('background-image: url("/usr/share/cinnamon/theme/add-workspace.png");');
235235

236-
this._windowCloseArea.set_position((primary.width - this._windowCloseArea.width) / 2 , primary.height);
236+
this._windowCloseArea.set_position((current.width - this._windowCloseArea.width) / 2 , current.height);
237237
this._windowCloseArea.set_size(this._windowCloseArea.width, this._windowCloseArea.height);
238238
this._windowCloseArea.raise_top();
239239
},
240240

241241
_showCloseArea : function() {
242-
let primary = Main.layoutManager.primaryMonitor;
242+
let current = Main.layoutManager.currentMonitor;
243243
this._windowCloseArea.show();
244244
this._windowCloseArea.ease({
245-
y: primary.height - this._windowCloseArea.height,
245+
y: current.height - this._windowCloseArea.height,
246246
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
247247
mode: Clutter.AnimationMode.EASE_OUT_QUAD
248248
});
249249
},
250250

251251
_hideCloseArea : function() {
252-
let primary = Main.layoutManager.primaryMonitor;
252+
let current = Main.layoutManager.currentMonitor;
253253
this._windowCloseArea.ease({
254-
y: primary.height,
254+
y: current.height,
255255
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
256256
mode: Clutter.AnimationMode.EASE_OUT_QUAD
257257
});
@@ -319,15 +319,15 @@ Expo.prototype = {
319319
Main.layoutManager.monitors.forEach(function(monitor,index) {
320320
let clone = clones[index];
321321
clone.ease({
322-
x: Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1,
323-
y: Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1,
324-
scale_x: activeWorkspaceActor.get_scale()[0] ,
325-
scale_y: activeWorkspaceActor.get_scale()[1],
322+
x: Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1,
323+
y: Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1,
324+
scale_x: activeWorkspaceActor.get_scale()[0] ,
325+
scale_y: activeWorkspaceActor.get_scale()[1],
326326
duration: Main.animations_enabled ? ANIMATION_TIME : 0,
327327
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
328328
onUpdate: (t, timeIndex) => {
329-
clone.get_transition("x")?.set_to(Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1);
330-
clone.get_transition("y")?.set_to(Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1);
329+
clone.get_transition("x")?.set_to(Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1);
330+
clone.get_transition("y")?.set_to(Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1);
331331
clone.get_transition("scale-x")?.set_to(activeWorkspaceActor.get_scale()[0]);
332332
clone.get_transition("scale-y")?.set_to(activeWorkspaceActor.get_scale()[1]);
333333
},
@@ -436,7 +436,7 @@ Expo.prototype = {
436436

437437
let clone = new Clutter.Clone({source: activeWorkspaceActor});
438438
cover.add_actor(clone);
439-
clone.set_position(Main.layoutManager.primaryMonitor.x + activeWorkspaceActor.allocation.x1, Main.layoutManager.primaryMonitor.y + activeWorkspaceActor.allocation.y1);
439+
clone.set_position(Main.layoutManager.currentMonitor.x + activeWorkspaceActor.allocation.x1, Main.layoutManager.currentMonitor.y + activeWorkspaceActor.allocation.y1);
440440
clone.set_clip(monitor.x, monitor.y, monitor.width, monitor.height);
441441
clone.set_scale(activeWorkspaceActor.get_scale()[0], activeWorkspaceActor.get_scale()[1]);
442442

0 commit comments

Comments
 (0)