Skip to content
Permalink
Browse files

Fix misplaced windows in overview

This fixes #8304

The actual texture position was way down because of the minimizing animation,
but the input rect reports the correct position of the window.
  • Loading branch information...
germanfr authored and mtwebster committed Jun 16, 2019
1 parent 369148f commit 94afc73576eb1c0fedcc02ccc87583ee1e362cb9
Showing with 5 additions and 5 deletions.
  1. +5 −5 js/misc/windowUtils.js
@@ -7,19 +7,19 @@ const Clutter = imports.gi.Clutter;
function createWindowClone(metaWindow, width, height, withTransients, withPositions) {
let clones = [];
let textures = [];

if (!metaWindow) {
return clones;
}

let metaWindowActor = metaWindow.get_compositor_private();
if (!metaWindowActor) {
return clones;
}
let texture = metaWindowActor.get_texture();
let [windowWidth, windowHeight] = metaWindowActor.get_size();
let [maxWidth, maxHeight] = [windowWidth, windowHeight];
let [x, y] = metaWindowActor.get_position();
let {x, y} = metaWindow.get_input_rect();
let [minX, minY] = [x, y];
let [maxX, maxY] = [minX + windowWidth, minY + windowHeight];
textures.push({t: texture, x: x, y: y, w: windowWidth, h: windowHeight});
@@ -28,7 +28,7 @@ function createWindowClone(metaWindow, width, height, withTransients, withPositi
let metaWindowActor = win.get_compositor_private();
texture = metaWindowActor.get_texture();
[windowWidth, windowHeight] = metaWindowActor.get_size();
[x, y] = metaWindowActor.get_position();
let { x, y } = win.get_input_rect();
maxWidth = Math.max(maxWidth, windowWidth);
maxHeight = Math.max(maxHeight, windowHeight);
minX = Math.min(minX, x);
@@ -50,7 +50,7 @@ function createWindowClone(metaWindow, width, height, withTransients, withPositi
if (width || height) {
scale = Math.min(scaleWidth, scaleHeight);
}

for (let i = 0; i < textures.length; i++) {
let data = textures[i];
let [texture, texWidth, texHeight, x, y] = [data.t, data.w, data.h, data.x, data.y];

0 comments on commit 94afc73

Please sign in to comment.
You can’t perform that action at this time.