Skip to content

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

Merged
PolyMeilex merged 5 commits intoPolyMeilex:masterfrom
stuartZhang:master
Nov 23, 2024
Merged

Bugfix: Fail to dismiss the Message Dialog merely in MacOS#223
PolyMeilex merged 5 commits intoPolyMeilex:masterfrom
stuartZhang:master

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
@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