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

In MacOS, MessageDialog fails to automatically collapse after the button "Ok" is clicked. #221

Closed
stuartZhang opened this issue Nov 7, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@stuartZhang
Copy link
Contributor

stuartZhang commented Nov 7, 2024

Hi genius,

I have written a demo which is able to reproduce the bug. Please download error-demo.zip and cargo run it in MacOS. My local MacOS version is image.

In a nutshell, even though the MessageDialog widget can't automatically collapse, the executing flow of the program isn't blocked. Namely, as soon as the button "Ok" on the MessageDialog widget is clicked,

  1. The method ".show()" instantly returns MessageDialogResult
  2. The subsequent MessageDialog with different title and message strings can be normally expanded and supersedes the old one as well.

However, the latest MessageDialog widget abnormally stays on the Desktop all the time, until the main process exits. The phenomenon merely occurs in MacOS.
image

@PolyMeilex PolyMeilex added bug Something isn't working help wanted Extra attention is needed labels Nov 8, 2024
@stuartZhang
Copy link
Contributor Author

stuartZhang commented Nov 10, 2024

Hi genius,

The failure of dismissing the dialog is a known fault of the widget NSAlert . According to the post, the another widget CFUserNotificationDisplayAlert is a good alternative underlying the MessageDialog use case. Good news! I have just found it in core-foundation-rs. The Objective-C API docs is here.

image

@PolyMeilex I'm not aware of how to invoke the function.

@stuartZhang
Copy link
Contributor Author

stuartZhang commented Nov 17, 2024

@PolyMeilex For this issue, I have just submitted a PR: #223

rfd-修复成果

@stuartZhang
Copy link
Contributor Author

The bugfix has been merged into the master branch. As a result, it's closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants