[Xfce4-commits] <midori:master> Fix race condition which causes a blank first tab

Christian Dywan noreply at xfce.org
Fri Apr 26 00:10:01 CEST 2013


Updating branch refs/heads/master
         to 9865598e7f79092760ba9439c9a1e60118021546 (commit)
       from 0e1ffed52d4cfd28a52a3fe09872611563cfe6db (commit)

commit 9865598e7f79092760ba9439c9a1e60118021546
Author: André Stösel <andre at stoesel.de>
Date:   Thu Apr 25 19:52:58 2013 +0200

    Fix race condition which causes a blank first tab

 extensions/delayed-load.vala |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/extensions/delayed-load.vala b/extensions/delayed-load.vala
index 9ea2c0f..21b6df3 100644
--- a/extensions/delayed-load.vala
+++ b/extensions/delayed-load.vala
@@ -1,5 +1,5 @@
 /*
-   Copyright (C) 2012 André Stösel <andre at stoesel.de>
+   Copyright (C) 2012-2013 André Stösel <andre at stoesel.de>
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -106,6 +106,7 @@ namespace DelayedLoad {
 
     private class Manager : Midori.Extension {
         private int timeout = 0;
+        private bool initialized = false;
         private HashTable<Midori.Browser, TabShaker> tasks;
 
         public signal void preferences_changed ();
@@ -140,7 +141,7 @@ namespace DelayedLoad {
                 item.ref();
 
                 int64 delay = item.get_meta_integer ("delay");
-                if (delay == Midori.Delay.PENDING_UNDELAY && new_view.progress < 1.0) {
+                if (delay == Midori.Delay.PENDING_UNDELAY && new_view.progress < 1.0 && this.initialized) {
                     this.schedule_reload (browser, new_view);
                 }
             }
@@ -152,6 +153,7 @@ namespace DelayedLoad {
             Midori.View? view = browser.tab as Midori.View;
 
             if (view != null) {
+                this.initialized = true;
                 Katze.Item item = view.get_proxy_item ();
                 item.ref();
 
@@ -189,6 +191,8 @@ namespace DelayedLoad {
             Midori.Browser? focused_browser = app.browser;
             if (focused_browser == null)
                 Midori.Timeout.add (50, this.reload_first_tab);
+            else
+                this.initialized = true;
 
             foreach (Midori.Browser browser in app.get_browsers ()) {
                 browser_added (browser);


More information about the Xfce4-commits mailing list