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

Bugfix: Fail to dismiss the Message Dialog merely in MacOS #223

Merged
merged 5 commits into from
Nov 23, 2024

Conversation

stuartZhang
Copy link
Contributor

@stuartZhang stuartZhang commented Nov 17, 2024

  1. Bug phenomenon: Only in MacOS, the message dialog originating from the command-line context fails to dismiss itself posterior to clicking the button "OK".
  2. Solution: If the parent-window handle is absent during the initialization of the MessageDialog instance, the alternative ABI CFUserNotificationDisplayAlert will be invoked to pop up a message dialog, instead of instantiating a NSAlert object.
  3. Ramification: Only message dialog for MacOS
  4. Unit Test: It covers both sync and async message dialogs and is run by cargo run --example msg

… the command-line context fails to dismissing itself posterior to click the button "OK".

2. Solution: If the parent-window handle is absent during the initialization of the MessageDialog instance, the ABI `CFUserNotificationDisplayAlert` will be invoked to pop up a message dialog, instead of instantiate a NSAlert instance.
3. Ramification: Only message dialog for MacOS
4. Unit Test: cover both sync and async message dialogs and run the unit test by `cargo run --example msg`
1. Remove the conditional dependency on the `futures` crate.
2. Relinquish the heavy thread-pool instrument.
3. Spawn a background thread by means of the std lib.
@PolyMeilex PolyMeilex merged commit c7c9537 into PolyMeilex:master Nov 23, 2024
12 of 13 checks passed
@PolyMeilex
Copy link
Owner

Thanks!

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.

2 participants