[gnome-shell/gnome-3-28] workspace: Recompute bounding box on window 'position-changed'



commit 8e5eab04984bcf3d1f5c3c787c24db93c94b2046
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Fri Jan 19 15:00:10 2018 +0100

    workspace: Recompute bounding box on window 'position-changed'
    
    We need to update the clone position if window size changed
    also, rename meta window 'size-changed' callback accordingly.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=792681

 js/ui/workspace.js | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 8b5693220..112c54e8c 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -137,8 +137,10 @@ var WindowClone = new Lang.Class({
         this._dragSlot = [0, 0, 0, 0];
         this._stackAbove = null;
 
-        this._windowClone._updateId = this.metaWindow.connect('size-changed',
-            this._onRealWindowSizeChanged.bind(this));
+        this._windowClone._sizeChangedId = this.metaWindow.connect('size-changed',
+            this._onMetaWindowSizeChanged.bind(this));
+        this._windowClone._posChangedId = this.metaWindow.connect('position-changed',
+            this._computeBoundingBox.bind(this));
         this._windowClone._destroyId =
             this.realWindow.connect('destroy', () => {
                 // First destroy the clone and then destroy everything
@@ -206,8 +208,7 @@ var WindowClone = new Lang.Class({
 
     addAttachedDialog(win) {
         this._doAddAttachedDialog(win, win.get_compositor_private());
-        this._computeBoundingBox();
-        this.emit('size-changed');
+        this._onMetaWindowSizeChanged();
     },
 
     hasAttachedDialogs() {
@@ -216,15 +217,14 @@ var WindowClone = new Lang.Class({
 
     _doAddAttachedDialog(metaWin, realWin) {
         let clone = new Clutter.Clone({ source: realWin });
-        clone._updateId = metaWin.connect('size-changed', () => {
-            this._computeBoundingBox();
-            this.emit('size-changed');
-        });
+        clone._sizeChangedId = metaWin.connect('size-changed',
+            this._onMetaWindowSizeChanged.bind(this));
+        clone._posChangedId = metaWin.connect('position-changed',
+            this._onMetaWindowSizeChanged.bind(this));
         clone._destroyId = realWin.connect('destroy', () => {
             clone.destroy();
 
-            this._computeBoundingBox();
-            this.emit('size-changed');
+            this._onMetaWindowSizeChanged();
         });
         this.actor.add_child(clone);
     },
@@ -321,12 +321,13 @@ var WindowClone = new Lang.Class({
             else
                 realWindow = child.source;
 
-            realWindow.meta_window.disconnect(child._updateId);
+            realWindow.meta_window.disconnect(child._sizeChangedId);
+            realWindow.meta_window.disconnect(child._posChangedId);
             realWindow.disconnect(child._destroyId);
         });
     },
 
-    _onRealWindowSizeChanged() {
+    _onMetaWindowSizeChanged() {
         this._computeBoundingBox();
         this.emit('size-changed');
     },


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