applications: Fix crash when loading as last-used panel

Let's call update_headerbar_buttons only after the panel
has been loaded.

Fixes #2590
This commit is contained in:
Felipe Borges 2023-08-01 14:05:31 +02:00
parent 4a9214b1b9
commit 6b4b478402
2 changed files with 7 additions and 9 deletions

View file

@ -736,6 +736,12 @@ maybe_load_last_panel (CcWindow *self)
cc_panel_list_set_active_panel (self->panel_list, id);
else
cc_panel_list_activate (self->panel_list);
g_signal_connect_swapped (self->panel_list,
"notify::view",
G_CALLBACK (update_headerbar_buttons),
self);
update_headerbar_buttons (self);
}
static void
@ -754,15 +760,6 @@ cc_window_constructed (GObject *object)
* activated from commandline parameter or from DBus method */
g_idle_add_once ((GSourceOnceFunc) maybe_load_last_panel, self);
g_signal_connect_swapped (self->panel_list,
"notify::view",
G_CALLBACK (update_headerbar_buttons),
self);
update_headerbar_buttons (self);
adw_leaflet_set_visible_child (self->main_leaflet,
GTK_WIDGET (self->sidebar_box));
G_OBJECT_CLASS (cc_window_parent_class)->constructed (object);
}

View file

@ -6,6 +6,7 @@
<child>
<object class="AdwLeaflet" id="main_leaflet">
<property name="can-navigate-back">True</property>
<property name="visible-child">sidebar_box</property>
<signal name="notify::folded" handler="on_main_leaflet_folded_changed_cb" object="CcWindow" swapped="yes" />
<child>