summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-07-20 16:58:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-07-20 16:58:08 (GMT)
commit109bf3ffe74492a9730a9127bfef9a138e811116 (patch)
tree09fc5d897b58b20d9d522f8ac712088535f3b98f /src
parenta809d3517eb928d5d7a03d96a85f8af96daa1047 (diff)
Ensured the GUI gets updated at startup.
Diffstat (limited to 'src')
-rw-r--r--src/gui/core/items.c12
-rw-r--r--src/gui/menus/view.c1
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);