[latexila/latexila-2-6] Fix the "New Window" action in gnome-shell



commit cd3e47d1822f61cbaa2241567a5273deeaa3e7c5
Author: SÃbastien Wilmet <swilmet gnome org>
Date:   Sat Feb 16 16:34:30 2013 +0100

    Fix the "New Window" action in gnome-shell
    
    When the application is "activated", it means that a new window must be
    created.

 src/latexila.vala |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)
---
diff --git a/src/latexila.vala b/src/latexila.vala
index e49064f..930d207 100644
--- a/src/latexila.vala
+++ b/src/latexila.vala
@@ -39,7 +39,7 @@ public class Latexila : Gtk.Application
         activate.connect (() =>
         {
             hold ();
-            active_window.present ();
+            create_window ();
             release ();
         });
 
@@ -119,8 +119,6 @@ public class Latexila : Gtk.Application
         new StockIcons ();
 
         AppSettings.get_default ();
-        create_window ();
-        reopen_files ();
         release ();
     }
 
@@ -198,7 +196,9 @@ public class Latexila : Gtk.Application
 
     public MainWindow create_window ()
     {
-        if (active_window != null)
+        bool first_window = active_window == null;
+
+        if (! first_window)
             active_window.save_state ();
 
         MainWindow window = new MainWindow ();
@@ -212,6 +212,10 @@ public class Latexila : Gtk.Application
         });
 
         window.show ();
+
+        if (first_window)
+            reopen_files ();
+
         return window;
     }
 


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