[bijiben] Change window's position if not first



commit 14c46eedfcc6c0a3e2e8d13ad2c3beca5c54ee21
Author: Pierre-Yves Luyten <py luyten fr>
Date:   Sun Feb 9 22:35:19 2014 +0100

    Change window's position if not first
    
    See #723837

 src/bjb-bijiben.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/bjb-bijiben.c b/src/bjb-bijiben.c
index 6c89ecc..6b25ded 100644
--- a/src/bjb-bijiben.c
+++ b/src/bjb-bijiben.c
@@ -110,12 +110,17 @@ bijiben_new_window_internal (Bijiben *self,
                              GError *error)
 {
   BjbWindowBase *window;
-  BijiNoteObj* note;
-  gchar *path;
+  BijiNoteObj   *note;
+  gchar         *path;
+  GList         *windows;
+  gboolean       not_first_window;
 
   note = NULL;
   path = NULL;
 
+  windows = gtk_application_get_windows (GTK_APPLICATION (self));
+  not_first_window = (gboolean) g_list_length (windows);
+
   if (file != NULL)
   {
     path = g_file_get_parse_name (file);
@@ -145,6 +150,9 @@ bijiben_new_window_internal (Bijiben *self,
     g_free (path);
 
   gtk_widget_show_all (GTK_WIDGET (window));
+
+  if (not_first_window)
+    gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER);
 }
 
 void


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