JuliaGraphics / Gtk.jl

Julia interface to Gtk windowing toolkit.
Other
290 stars 80 forks source link

REPL lag in Windows #629

Open jwahlstrand opened 2 years ago

jwahlstrand commented 2 years ago

Per a discussion on discourse (https://discourse.julialang.org/t/julia-causing-latency/76938) and confirmed by me, Gtk.jl is causing lags in the REPL in Windows. Setting GTK_AUTO_IDLE=false fixes it for me.

giordano commented 2 years ago

Duplicate of #325?

jwahlstrand commented 2 years ago

Yeah, this is the same symptom, but I only see it when auto-idle is enabled. It looks like #521 mostly fixed the lag issue reported in #325, but not universally. Not to be a nuisance, but I will just add that #628 fixes this for me.

jwahlstrand commented 2 years ago

I think https://gitlab.gnome.org/GNOME/gtk/-/issues/2015 is the root cause of this problem and maybe #325.

When you start libgdk3 but don't run the main loop, there is a bug that causes keyboard lag on Windows. It makes sense that auto-idle would trigger this since it doesn't run the loop. Creating a window makes the REPL lag go away, which fits because the loop is now running. It also might make sense that reducing the timeout (#521) would make this lag less noticeable, since it probably lets the loop iterate more quickly.

The recommended solution is to compile libgtk with a one line patch removing a call to set_up_low_level_keyboard_hook().