From a6d878beb250ab6d9435c8b9377bf60d241d8bbd Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Fri, 15 Nov 2024 10:31:09 +0600 Subject: [PATCH] Fixed crash while root restart --- source/ubl-settings-kernel.c | 4 +++- source/ubl-settings-kernel.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/source/ubl-settings-kernel.c b/source/ubl-settings-kernel.c index 4c82365..0d71e08 100644 --- a/source/ubl-settings-kernel.c +++ b/source/ubl-settings-kernel.c @@ -982,6 +982,7 @@ void yon_main_window_complete(main_window *widgets){ g_signal_connect(G_OBJECT(widgets->LoadLocalMenuItem),"activate",G_CALLBACK(on_config_local_load),widgets); g_signal_connect(G_OBJECT(widgets->LoadCustomMenuItem),"activate",G_CALLBACK(on_config_custom_load),widgets); + yon_root_button_setup((template_main_window*)widgets,main_config.launch_arguments,main_config.launch_size); if (getuid()){ gtk_widget_set_sensitive(widgets->BuildingButton,0); } @@ -1012,10 +1013,11 @@ int main(int argc, char *argv[]){ yon_ubl_setup_arguments(argc,argv,&unfound,&size,NULL); gtk_init(&argc,&argv); template_main_window *widgets = yon_ubl_window_setup(); - yon_root_button_setup(widgets,argv,argc); yon_main_window_complete((main_window*)widgets); char *path = yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL); yon_window_config_load(path); + main_config.launch_arguments=yon_char_parsed_copy(argv,argc); + main_config.launch_size=argc; if (getuid()!=0){ textdomain(template_ui_LocaleName); yon_ubl_status_box_render(ROOT_WARNING_LABEL,BACKGROUND_IMAGE_FAIL_TYPE); diff --git a/source/ubl-settings-kernel.h b/source/ubl-settings-kernel.h index d602107..648d064 100644 --- a/source/ubl-settings-kernel.h +++ b/source/ubl-settings-kernel.h @@ -81,6 +81,8 @@ typedef struct { int pulse_active; GMutex progress_mutex; int progress_active; + config_str launch_arguments; + int launch_size; } config; typedef struct {