[gnome-weather] Application: split creating the window from showing it



commit a3ad7b81dbca4faed634fe806bd5d6762e490ca6
Author: Giovanni Campagna <gcampagna src gnome org>
Date:   Fri Mar 6 20:39:34 2015 -0800

    Application: split creating the window from showing it
    
    So that we can make sure the window is shown only when it's fully
    populated, as the first map of the window skips the frame clock
    machinery.

 src/app/main.js |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/app/main.js b/src/app/main.js
index 9fcde7a..a6878c0 100644
--- a/src/app/main.js
+++ b/src/app/main.js
@@ -62,6 +62,7 @@ const Application = new Lang.Class({
 
         let info = this.model.addNewLocation(location, false);
         win.showInfo(info, false);
+        this._showWindowWhenReady(win);
     },
 
     _onShowSearch: function(action, parameter) {
@@ -69,6 +70,7 @@ const Application = new Lang.Class({
         let win = this._createWindow();
 
         win.showSearch(text);
+        this._showWindowWhenReady(win);
     },
 
     _initAppMenu: function() {
@@ -122,7 +124,10 @@ const Application = new Lang.Class({
     },
 
     _createWindow: function() {
-        let win = new Window.MainWindow({ application: this });
+        return new Window.MainWindow({ application: this });
+    },
+
+    _showWindowWhenReady: function(win) {
         let notifyId;
 
         if (this.model.loading) {
@@ -153,6 +158,7 @@ const Application = new Lang.Class({
     vfunc_activate: function() {
         let win = this._createWindow();
         win.showDefault();
+        this._showWindowWhenReady(win);
     },
 
     vfunc_shutdown: function() {


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