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

WIP: macos: Always run TIS.. and NS.. functions on main thread #414

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pentamassiv
Copy link
Collaborator

Some functions can only be called from the main thread. If they are called from another thread, it can lead to panics. This likely is the cause for Tauri crashing with enigo. There are functions available to send functions to the main thread that then get executed there. We should use those so enigo can be used from other threads too

In order to find out which functions have to get executed on the main thread, we can run the examples with (source):

DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/usr/lib/libMainThreadChecker.dylib MTC_RESET_INSERT_LIBRARIES=0 cargo run

Fixes #153
Fixes tauri-apps/tauri#6421
Fixes #352
Might fix #340

@pentamassiv pentamassiv marked this pull request as draft March 24, 2025 15:41
Some functions can only be called from the main thread. If they are called from another thread, it can lead to panics. This likely is the cause for Tauri crashing with enigo. There are functions available to send functions to the main thread that then get executed there. We should use those so enigo can be used from other threads too

Fixes enigo-rs#153
Fixes tauri-apps/tauri#6421
Fixes enigo-rs#352
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant