Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linux): call gtk_init to fix tauri-apps/tauri#11312 #1036

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

FabioGNR
Copy link

This fixes tauri-apps/tauri#11312, this issue also contains some more information regarding this change.

To summarize, on Linux a crash is seen where gtk-rs fails an assert with error message "GTK may only be used from the main thread".

In tao, gtk::Application::new is used which should remove the need for calling gtk::init(). I believe there's a bug here, in either gtk-rs or gtk itself, but I've been unable to check this so far, where gtk::init() is not called or gtk-rs' internal INITIALIZED variable is not updated.

Later on at attempted use of a GTK function we get the failed assert and crash afterwards.

Adding an explicit gtk::init() call here fixes this issue. Calling this function multiple times should have no negative side effects, as there is a check to skip initializing when already done.

There are some unknowns:

  • Why was this introduced around 2.0.0? Did something previously call gtk_init through some (indirect) path?
  • Why does gtk::Application::new not work as expected?

Reference documentation:

@FabioGNR FabioGNR requested a review from a team as a code owner December 17, 2024 21:25
Copy link
Contributor

Package Changes Through 12a0a18

There are 1 changes which include tao with patch

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
tao 0.31.0 0.31.1

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] *intermittent* GTK may only be used from the main thread
1 participant