Search code examples
pythondbus

python dbus script loads CPU core to its max (evince-synctex)


I am trying to use this script: https://github.com/latex-lsp/evince-synctex to run forward search from vscode. It generally works as intended, however, as long as the evince window with the document is open, it loads one of the CPU cores to its max (while just awaiting for ctrl-click) This makes utility of the script in mobile setting very limited. Any help from experts is appreciated!


Solution

  • After some testing I found that the issue is caused by the GLib.idle_add(...) in line 180 which causes the process exit check be constantly called. Replaced it with

    GLib.timeout_add(1000,poll_viewer_process)

    which calls the check once a second. This fixes the CPU load issue...