ysbaddaden / brium-app

MIT License
1 stars 0 forks source link

Build on Windows #7

Open ysbaddaden opened 1 year ago

ysbaddaden commented 1 year ago

Gtk3 is available for Windows.

The problem is figuring out how to install Gtk3 dev and gintrospection, then get to a point where the gobject shard is running (you can compile and run samples).

Once Crystal and Gtk3 are setup, you should be able to build an executable for Windows?

ysbaddaden commented 1 year ago

I have zero knowledge of Windows. Help is welcomed!

ysbaddaden commented 1 year ago

Probably blocked by https://github.com/crystal-lang/crystal/pull/13419 since the app relies on MT, or we shall use another hack (call Fiber.yield in GLib.timeout_milliseconds callback) on Windows.

Alternatively we could try to integrate the Gtk event loop with Crystal event loop (see g_main_context_set_poll_func). The difficulty being that we can't block forever waiting for an event (the GPollFunc callback receives a timeout parameter), otherwise we'd block the UI.

Last alternative, start a thread to run Gtk and add a mechanism to exit the main thread when the Gtk thread has terminated (not before). I implemented that (to avoid some hacks) but we still need preview_mt to turn on thread safety guards.