diff --git a/.changes/explicit_gtk_init.md b/.changes/explicit_gtk_init.md new file mode 100644 index 000000000..4b51f84b4 --- /dev/null +++ b/.changes/explicit_gtk_init.md @@ -0,0 +1,5 @@ +--- +"tao": patch +--- + +Call `gtk::init` when creating the eventloop to fix crashes with some gtk APIs. diff --git a/src/platform_impl/linux/event_loop.rs b/src/platform_impl/linux/event_loop.rs index e39ee9f19..39bb014d3 100644 --- a/src/platform_impl/linux/event_loop.rs +++ b/src/platform_impl/linux/event_loop.rs @@ -215,6 +215,8 @@ impl EventLoop { } fn new_gtk(app_id: Option<&str>) -> Result, Box> { + // This should be done by gtk::Application::new, but does not work properly + gtk::init()?; let context = MainContext::default(); let app = gtk::Application::new(app_id, gio::ApplicationFlags::empty()); let app_ = app.clone();