Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Fri, 14 Jun 2024 21:28:43 UTC Commit: 94838739140cd0552a91a3eecc0013d00f99a11f https://github.com/geany/geany/commit/94838739140cd0552a91a3eecc0013d00f99a1...
Log Message: ----------- Merge pull request #3902 from techee/progressbar_cpu
Fix elevated CPU usage after ui_progress_bar_start/stop() is used
Modified Paths: -------------- src/printing.c src/ui_utils.c
Modified: src/printing.c 2 lines changed, 2 insertions(+), 0 deletions(-) =================================================================== @@ -292,6 +292,8 @@ static void end_print(GtkPrintOperation *operation, GtkPrintContext *context, gp if (dinfo == NULL) return;
+ /* see ui_progress_bar_stop() for more details on why this is called */ + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.progressbar), 0.0); gtk_widget_hide(main_widgets.progressbar); g_object_unref(dinfo->sci); g_object_unref(dinfo->layout);
Modified: src/ui_utils.c 4 lines changed, 4 insertions(+), 0 deletions(-) =================================================================== @@ -2863,6 +2863,10 @@ void ui_progress_bar_stop(void) g_source_remove(progress_bar_timer_id); progress_bar_timer_id = 0; } + + /* hack to remove tick callback which is created for "activity mode" progress + * bars - without this it is called forever and causes elevated CPU usage */ + gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_widgets.progressbar), 0.0); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).