diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 457ab14..afd54e0 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -30,7 +30,7 @@ endif() # -O2 -pipe -fno-plt -fexceptions \ # -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security \ # -fstack-clash-protection -fcf-protection") - +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g") add_library(${PROJECT_NAME} SHARED ${PROJECT_NAME}.c ${PROJECT_NAME}.h) diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index a29fde6..c8a1aac 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -730,17 +730,16 @@ static char *yon_status_thread_id=NULL; void _yon_ubl_status_box_timed_remove(struct temp_statusbox *statusstruct){ sleep(statusstruct->times); - if (status_thread_busy){ + if (statusstruct->revealer){ gtk_revealer_set_reveal_child(GTK_REVEALER(statusstruct->revealer),0); sleep(1); gtk_widget_destroy(statusstruct->revealer); } - status_thread_busy=0; } -void __yon_ubl_status_box_destroyed(){ - status_thread_busy=0; +void __yon_ubl_status_box_destroyed(GtkWidget *self,struct temp_statusbox *statusstruct){ + statusstruct->revealer=NULL; } void yon_status_box_destroyed(){ @@ -751,7 +750,7 @@ void yon_status_box_destroyed(){ } int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *status_id, char *display_text, BACKGROUND_IMAGE_TYPE type){ - if (!status_thread_busy){ + if (!gtk_container_get_children(container)){ if (yon_status_thread_id){ if (!strcmp(yon_status_thread_id,status_id)){ return 0; @@ -762,7 +761,6 @@ int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *status_id, for (int i=0;irevealer = revealer; } } @@ -829,7 +827,7 @@ int yon_ubl_status_box_despawn_infinite(GtkContainer *container){ } void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int timeout,BACKGROUND_IMAGE_TYPE type){ - if (!status_thread_busy){ + if (!gtk_container_get_children(container)){ GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,5); GtkWidget *revealer = gtk_revealer_new(); GtkWidget *label = gtk_label_new(""); @@ -843,7 +841,6 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti gtk_widget_show_all(revealer); gtk_revealer_set_reveal_child(GTK_REVEALER(revealer),1); - g_signal_connect(G_OBJECT(revealer),"destroy", G_CALLBACK(__yon_ubl_status_box_destroyed),NULL); gtk_widget_set_margin_bottom(label,9); gtk_widget_set_margin_top(label,9); @@ -868,8 +865,8 @@ void yon_ubl_status_box_spawn(GtkContainer *container,char *display_text, int ti struct temp_statusbox *statusstruct = malloc(sizeof(struct temp_statusbox)); statusstruct->revealer = revealer; statusstruct->times = timeout; + g_signal_connect(G_OBJECT(revealer),"destroy", G_CALLBACK(__yon_ubl_status_box_destroyed),statusstruct); GThread *thread = g_thread_new("StatusThread",(GThreadFunc)_yon_ubl_status_box_timed_remove,statusstruct); - status_thread_busy=1; } }