Skip to content

Commit b5c4648

Browse files
committed
FIX: when in overview, moving the mouse to another monitor causes
workspace switching and activation.
1 parent 924af81 commit b5c4648

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

overviewlayout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@ export function sortWindows(a, b) {
261261
return 0;
262262
}
263263
if (!aw) {
264-
return 1;
264+
return -1;
265265
}
266266
if (!bw) {
267-
return -1;
267+
return 1;
268268
}
269269

270270
let spaceA = Tiling.spaces.spaceOfWindow(aw);

stackoverlay.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ export function multimonitorSupport() {
6969
export function enableMultimonitorSupport() {
7070
pointerWatch = PointerWatcher.getPointerWatcher().addWatch(100,
7171
() => {
72+
// if overview return
73+
if (Main.overview.visible) {
74+
return;
75+
}
76+
7277
const monitor = Utils.monitorAtCurrentPoint();
7378
const space = Tiling.spaces.monitors.get(monitor);
7479

tiling.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,17 @@ export class Space extends Array {
367367
if (!spaces.isActiveSpace(this)) {
368368
return;
369369
}
370-
// warp pointer to monitor that is active
371-
Utils.warpPointerToMonitor(this.monitor);
370+
371+
// check if after hiding the mouse is on another monitor
372+
const monitor = Utils.monitorAtCurrentPoint();
373+
const space = spaces.monitors.get(monitor);
374+
375+
// if space is different, activate that one
376+
if (this !== space) {
377+
space?.activateWithFocus(space?.selectedWindow, false, false);
378+
Utils.warpPointerToMonitor(monitor);
379+
}
380+
372381
Utils.later_add(Meta.LaterType.IDLE, () => {
373382
this.moveDone(() => {
374383
ensureViewport(display.focus_window, this, {

0 commit comments

Comments
 (0)