From a817a40580e537fad592baed2c278f3adf31e9d7 Mon Sep 17 00:00:00 2001 From: ItsZariep Date: Thu, 9 Oct 2025 01:53:49 -0600 Subject: [PATCH] Fix segfault when loading accels config Fix #699 by moving load_accels() inside of xed_app_startup() --- xed/xed-app.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/xed/xed-app.c b/xed/xed-app.c index 1ccf033b..85809f2d 100644 --- a/xed/xed-app.c +++ b/xed/xed-app.c @@ -266,6 +266,20 @@ setup_theme_extensions (void) theme_changed (settings, NULL, NULL); } +static void +load_accels (void) +{ + gchar *filename; + + filename = g_build_filename (xed_dirs_get_user_config_dir (), "accels", NULL); + if (filename != NULL) + { + xed_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename); + gtk_accel_map_load (filename); + g_free (filename); + } +} + static void xed_app_startup (GApplication *application) { @@ -282,6 +296,7 @@ xed_app_startup (GApplication *application) GtkCssProvider *provider; G_APPLICATION_CLASS (xed_app_parent_class)->startup (application); + load_accels (); /* Setup debugging */ xed_debug_init (); @@ -893,20 +908,6 @@ xed_app_class_init (XedAppClass *klass) app_class->shutdown = xed_app_shutdown; } -static void -load_accels (void) -{ - gchar *filename; - - filename = g_build_filename (xed_dirs_get_user_config_dir (), "accels", NULL); - if (filename != NULL) - { - xed_debug_message (DEBUG_APP, "Loading keybindings from %s\n", filename); - gtk_accel_map_load (filename); - g_free (filename); - } -} - static void load_page_setup (XedApp *app) { @@ -994,8 +995,6 @@ xed_app_init (XedApp *app) g_application_add_option_group (G_APPLICATION (app), g_irepository_get_option_group ()); #endif - load_accels (); - setup_actions (app); }