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



commit 3e2f1bf48f80d769c50641600225eb4a310075dd
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 |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/latexila.vala b/src/latexila.vala
index 9704adc..1df2caa 100644
--- a/src/latexila.vala
+++ b/src/latexila.vala
@@ -37,7 +37,7 @@ public class Latexila : Gtk.Application
         activate.connect (() =>
         {
             hold ();
-            active_window.present ();
+            create_window ();
             release ();
         });
 
@@ -109,8 +109,6 @@ public class Latexila : Gtk.Application
         new StockIcons ();
 
         AppSettings.get_default ();
-        create_window ();
-        reopen_files ();
         Gtk.AccelMap.load (get_accel_filename ());
         release ();
     }
@@ -189,7 +187,9 @@ public class Latexila : Gtk.Application
 
     public MainWindow create_window ()
     {
-        if (active_window != null)
+        bool first_window = active_window == null;
+
+        if (! first_window)
         {
             MainWindow window = active_window as MainWindow;
             window.save_state ();
@@ -199,6 +199,9 @@ public class Latexila : Gtk.Application
         add_window (new_window);
         new_window.show ();
 
+        if (first_window)
+            reopen_files ();
+
         return new_window;
     }
 


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