Bug fix: Layout window IDs not correct
authorColin Clark <colin.clark@cclark.uk>
Thu, 14 Sep 2023 11:04:17 +0000 (12:04 +0100)
committerColin Clark <colin.clark@cclark.uk>
Thu, 14 Sep 2023 11:04:17 +0000 (12:04 +0100)
Layout window IDs were not being incremented when new windows were
displayed.

Bugs remain:
If a default layout has not been created, it is necessary to click on
the image for the displayed window ID to be displayed correctly.

src/layout.cc
src/preferences.cc

index 9689146..2adcb86 100644 (file)
@@ -3082,13 +3082,15 @@ LayoutWindow *layout_new_from_default()
                {
                work = g_list_last(layout_window_list);
                lw = static_cast<LayoutWindow *>(work->data);
-               g_free(lw->options.id);
-               lw->options.id = g_strdup(layout_get_unique_id());
                }
        else
                {
                lw = layout_new_from_config(nullptr, nullptr, TRUE);
                }
+
+       g_free(lw->options.id);
+       lw->options.id = g_strdup(layout_get_unique_id());
+
        return lw;
 }
 
index 09975cf..bdc7040 100644 (file)
@@ -2264,7 +2264,7 @@ static void save_default_window_layout_cb(GtkWidget *, gpointer)
        layout_valid(&lw);
 
        tmp_id = lw->options.id;
-       lw->options.id = g_strdup("lw_default");
+       lw->options.id = g_strdup("");
 
        default_path = g_build_filename(get_rc_dir(), DEFAULT_WINDOW_LAYOUT, NULL);
        save_default_layout_options_to_file(default_path, options, lw);