[gnome-shell/gnome-3-18] windowManager: Fix fullscreen animations on dualscreen



commit ab2ca17b766556eec7c5c47c4d75ef6ff45a31a7
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Oct 16 15:36:33 2015 +0200

    windowManager: Fix fullscreen animations on dualscreen
    
    The translation should describe the difference between the fullscreened
    and unfullscreened position of the window - however we are currently
    assuming a fullscreen position of (0, 0) instead of the monitor's origin,
    which causes glitches on dualscreen setups.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756697

 js/ui/windowManager.js |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
index 2ee99e3..c8996d8 100644
--- a/js/ui/windowManager.js
+++ b/js/ui/windowManager.js
@@ -1235,15 +1235,17 @@ const WindowManager = new Lang.Class({
     },
 
     _fullscreenWindow: function(shellwm, actor, oldFrameRect, oldBufferRect) {
-        actor.translation_x = oldFrameRect.x;
-        actor.translation_y = oldFrameRect.y;
+        let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()];
+        actor.translation_x = oldFrameRect.x - monitor.x;
+        actor.translation_y = oldFrameRect.y - monitor.y;
         this._fullscreenAnimation(shellwm, actor, oldFrameRect);
     },
 
     _unfullscreenWindow: function(shellwm, actor, oldFrameRect, oldBufferRect) {
         let targetRect = actor.meta_window.get_frame_rect();
-        actor.translation_x = -targetRect.x;
-        actor.translation_y = -targetRect.y;
+        let monitor = Main.layoutManager.monitors[actor.meta_window.get_monitor()];
+        actor.translation_x = -(targetRect.x - monitor.x);
+        actor.translation_y = -(targetRect.y - monitor.y);
         this._fullscreenAnimation(shellwm, actor, oldFrameRect);
     },
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]