Added a bunch of gdk_threads_enter() magic. TBD.