After calling
```
ui_progress_bar_start("foo");
...
ui_progress_bar_stop();
```

which should theoretically completely stop the progress bar, I get elevated CPU 
usage of the whole Geany process ~1% CPU on idle (and around 4% on macOS) 
compared to 0% after Geany launch before the status bar progress bar is used 
(e.g. by compiling). GTK seems to keep the widget connected to "tick 
callback" which causes the higher CPU (in fact, there's no 
gtk_progress_bar_stop() so it can't do it).

The workaround to fix this problem is to call
```
gtk_progress_bar_set_fraction()
```
which switches the progress bar to the mode where it shows the user-provided 
progress and this removes the "tick callback".

Am I crazy or can others reproduce this too? It was quite a bug hunt - first I 
suspected the LSP plugin (clangd indexes files on start which creates the 
progress bar which made it confusing), then jsonrpc-glib, then the blinking 
caret or Scintilla notifications, then Geany, and finally I got to GTK (3.24.38 
to be precise).


You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3902

-- Commit Summary --

  * Fix elevated CPU usage after ui_progress_bar_start/stop() is used

-- File Changes --

    M src/printing.c (2)
    M src/ui_utils.c (4)

-- Patch Links --

https://github.com/geany/geany/pull/3902.patch
https://github.com/geany/geany/pull/3902.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3902
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/[email protected]>

Reply via email to