diff --git a/source/libublsettings-gtk3.c b/source/libublsettings-gtk3.c index 5fb6ace..96a00bf 100644 --- a/source/libublsettings-gtk3.c +++ b/source/libublsettings-gtk3.c @@ -682,6 +682,8 @@ struct temp_statusbox { GtkWidget *revealer; }; +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){ @@ -697,12 +699,33 @@ void __yon_ubl_status_box_destroyed(){ status_thread_busy=0; } -int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *display_text, BACKGROUND_IMAGE_TYPE type){ +void yon_status_box_destroyed(){ + if (yon_status_thread_id){ + free(yon_status_thread_id); + yon_status_thread_id=NULL; + } +} + +int yon_ubl_status_box_spawn_infinite(GtkContainer *container, char *status_id, char *display_text, BACKGROUND_IMAGE_TYPE type){ if (!status_thread_busy){ + if (yon_status_thread_id){ + if (!strcmp(yon_status_thread_id,status_id)){ + return 0; + } + free(yon_status_thread_id); + GList *list = gtk_container_get_children(container); + for (int i=0;irevealer = revealer; - status_thread_busy=2; } } int _yon_ubl_status_box_despawn_infinite(GtkContainer *container){ + if (yon_status_thread_id){ + free(yon_status_thread_id); + yon_status_thread_id=NULL; + } GList *list = gtk_container_get_children(container); for (int i=0; i