From 109bf3ffe74492a9730a9127bfef9a138e811116 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Fri, 20 Jul 2018 18:58:08 +0200
Subject: Ensured the GUI gets updated at startup.

---
 src/gui/core/items.c | 12 ++++++++++--
 src/gui/menus/view.c |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/gui/core/items.c b/src/gui/core/items.c
index ad2de2c..68d2556 100644
--- a/src/gui/core/items.c
+++ b/src/gui/core/items.c
@@ -33,6 +33,10 @@
 /* Liste des éléments enregistrés */
 static GEditorItem *_editem_list = NULL;
 
+/* Initialisations premières de façon unique */
+static bool _first_content_change = true;
+static bool _first_panel_change = true;
+
 
 /* Lance une procédure de déplacement de la position courante. */
 static void start_moving_to_cursor_in_loaded_panel(GLoadedPanel *, const GLineCursor *, gboolean, gpointer);
@@ -80,8 +84,10 @@ void change_editor_items_current_content(GLoadedContent *content)
 
     old = get_current_content();
 
-    if (content != old)
+    if (content != old || _first_content_change)
     {
+        _first_content_change = false;
+
         set_current_content(content);
 
         editem_list_for_each(iter, _editem_list)
@@ -186,8 +192,10 @@ void change_editor_items_current_view(GLoadedPanel *panel)
 
     old = get_current_view();
 
-    if (panel != old)
+    if (panel != old || _first_panel_change)
     {
+        _first_panel_change = false;
+
         set_current_view(panel);
 
         editem_list_for_each(iter, _editem_list)
diff --git a/src/gui/menus/view.c b/src/gui/menus/view.c
index 8c34950..e1f95a1 100644
--- a/src/gui/menus/view.c
+++ b/src/gui/menus/view.c
@@ -452,6 +452,7 @@ static void update_switch_access_in_menu_view(void)
 
     if (panel == NULL)
         content = NULL;
+
     else
     {
         content = g_loaded_panel_get_content(panel);
-- 
cgit v0.11.2-87-g4458