The latest crates update is about tightening up the safety guarantees.

Initialization and threads

  • gdk and gtk will panic if you try to use them prior to calling gtk::init or from any thread but the main1 one. We intend to add a set of APIs with static checks but there’s no specific plan at the moment.
  • glib::idle_add and glib::timeout_add now require the closure to be Send because it might get executed on a different thread.
  • gtk has got relaxed versions of these, that don’t require Send but will panic if called from non-main1 thread.
  • Panicking in a callback will terminate the process because unwinding across FFI is not allowed.

Unfinished APIs

What’s up with the documentation?

We’ve realized that we can’t take the documentation from an LGPL licensed library and just slip it into an MIT-licensed one. Consequently we had to move almost all doc comments into a separate repo. We will keep maintaining online documentation and @GuillaumeGomez is working on a tool, that will allow to put the doc comments back locally.

  1. We currently define the main thread as one, on which gtk::init was called. This does not reflect the OSX requirements well and will be adjusted in the future.  2