unkaktus / onionize

create an onion site from a directory, file, zip or an HTTP(S) site
Creative Commons Zero v1.0 Universal
30 stars 5 forks source link

Rewrite GUI in thread safe way #18

Closed unkaktus closed 7 years ago

unkaktus commented 7 years ago

Pango:ERROR:/build/pango1.0-hEi7pY/pango1.0-1.36.8/./pango/pango-layout.c:3916:pango_layout_check_lines: assertion failed: (!layout->log_attrs) GUI is complicated as hell. What am I doing wrong??

unkaktus commented 7 years ago

This also seems to be related: (onionize:2659): Gdk-CRITICAL **: gdk_window_get_width: assertion 'GDK_IS_WINDOW (window)' failed. Perhaps removing widgets is not a good idea? Sometimes it doesn't work...

unkaktus commented 7 years ago

It likely because I adjust widgets in another thread.

unkaktus commented 7 years ago

https://github.com/gotk3/gotk3-examples/blob/master/gtk-examples/goroutines/goroutines.go:

    // Native GTK is not thread safe, and thus, gotk3's GTK bindings may not
    // be used from other goroutines.  Instead, glib.IdleAdd() must be used
    // to add a function to run in the GTK main loop when it is in an idle
        // state.
unkaktus commented 7 years ago

Fixed in fc0e1cb5d2d0f1b5327ce191db183fd979801e83