[sushi/wip/cosimoc/no-clutter: 37/67] mainWindow: resize window on size-allocate



commit 457542d2e656a63e78e037b0a002a3ff1e1b4a75
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Apr 3 12:46:23 2017 -0700

    mainWindow: resize window on size-allocate
    
    Whenever we get a new allocation for the window contents, we should also
    recompute the window size.

 src/js/ui/mainWindow.js |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 8214a90..28f58ea 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -84,6 +84,8 @@ const MainWindow = new Lang.Class({
                                 Lang.bind(this, this._onMotionNotifyEvent));
         this._gtkWindow.connect('realize',
                                 Lang.bind(this, this._onRealize));
+        this._gtkWindow.connect('size-allocate',
+                                Lang.bind(this, this._onSizeAllocate));
 
         this._embed = new Gtk.Overlay();
         this._gtkWindow.add(this._embed);
@@ -103,6 +105,13 @@ const MainWindow = new Lang.Class({
                                                    Gdk.WMFunction.CLOSE);
     },
 
+    _onSizeAllocate: function() {
+        if (!this._renderer)
+            return;
+
+        this._positionTexture();
+    },
+
     _onKeyPressEvent : function(widget, event) {
         let key = event.get_keyval()[1];
 


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