From 1256af7b9a6afb4f8bab82636e41e6be8ee9eb5f Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Sat, 15 Dec 2012 03:24:23 +0100 Subject: [PATCH] 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 --- js/ui/windowManager.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js index 372d9a303..60e0837ae 100644 --- a/js/ui/windowManager.js +++ b/js/ui/windowManager.js @@ -247,16 +247,17 @@ const WindowManager = new Lang.Class({ */ this._minimizing.push(actor); - let primary = Main.layoutManager.primaryMonitor; - let xDest = primary.x; + let monitor = Main.layoutManager.findMonitorForWindow(actor.meta_window); + let xDest = monitor.x; + let yDest = monitor.y; if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) - xDest += primary.width; + xDest += monitor.width; Tweener.addTween(actor, { scale_x: 0.0, scale_y: 0.0, x: xDest, - y: 0, + y: yDest, time: WINDOW_ANIMATION_TIME, transition: 'easeOutQuad', onComplete: this._minimizeWindowDone,