WindowManager: scale windows to their monitor's corner on minimize

We previously scaled windows to (primary.x, 0), which is wrong if the
primary monitor is not at y == 0. At the same time, change the policy
to pick the hot corner on the monitor the window is on, because that's
closest to where it will appear in the overview.

https://bugzilla.gnome.org/show_bug.cgi?id=690241
This commit is contained in:
Giovanni Campagna 2012-12-15 03:24:23 +01:00
parent b38ecaf925
commit 1256af7b9a

View File

@ -247,16 +247,17 @@ const WindowManager = new Lang.Class({
*/ */
this._minimizing.push(actor); this._minimizing.push(actor);
let primary = Main.layoutManager.primaryMonitor; let monitor = Main.layoutManager.findMonitorForWindow(actor.meta_window);
let xDest = primary.x; let xDest = monitor.x;
let yDest = monitor.y;
if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL)
xDest += primary.width; xDest += monitor.width;
Tweener.addTween(actor, Tweener.addTween(actor,
{ scale_x: 0.0, { scale_x: 0.0,
scale_y: 0.0, scale_y: 0.0,
x: xDest, x: xDest,
y: 0, y: yDest,
time: WINDOW_ANIMATION_TIME, time: WINDOW_ANIMATION_TIME,
transition: 'easeOutQuad', transition: 'easeOutQuad',
onComplete: this._minimizeWindowDone, onComplete: this._minimizeWindowDone,