Closed piegamesde closed 3 years ago
I've managed to replicate it: https://gist.github.com/idanarye/50bf4833c6968980c3c891b756dec8df/38430ef9c90687b26db83cded70a5b26e5698a7e
The problem is that GTK segfaults if you are trying to set the application window outside the activate
signal. Note that in the gist I'm creating the actor inside connect_activate
- but apparently Actix will not run its started
method yet. By the time Actix runs it, the activate
signal is already over.
Possible solution - use woab::route_signal
instead of connect_activate
:
https://gist.github.com/idanarye/50bf4833c6968980c3c891b756dec8df/6b5b9f7a3c10e7d16fd9b54c546cf22da328fb64
Either way, this is something that deserves a mention under Pitfalls.
I already ran into this several months ago, but I had too many other things to deal with for reporting (and I hoped that some refactorings would make it go away). Anyways:
My application has a window (
gtk::ApplicationWindow
), and I externally create agtk::Application
. I link them using:The weird fact is, that it matters where I call that function. If I call it within my original initialization (now in
woab::block_on
), it works fine. But if I call it within thestarted
method of my main actor, it sefaults for some reason. It is only a minor annoyance once you know the workaround (I still think that line would be better off instarted
, but eeh), but initially it took me quite a lot of time to figure out.Let me know if you can reproduce this, otherwise I'll try to provide a minimized example.