App dialogs not dismissing
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 827
- Avg merge
- 15h 39m
- Merged PRs (30d)
- 40
Description
### Describe the bug
In the example below:
- the window dialog works as expected
- the app dialog does not (more specifically it generally does not dismiss unless clicking the yes button rapidly for a while)
I suspect this is a bug?
### How to reproduce the bug
see code sample below
### Minimum example code
```shell
import toga
class App(toga.App):
def __init__(self):
super().__init__(formal_name='formal_name', app_id='app_id')
def startup(self):
main_window = toga.MainWindow()
main_window.show()
self.main_window = main_window
async def on_exit(self) -> bool:
question_dialog = toga.QuestionDialog('Exit?', 'Exit?')
# dialog in window context
# always seems to work
# return await self.main_window.dialog(question_dialog)
# dialog in app context
# mostly does not seem to work
# - clicking yes or no generally does not dismiss the dialog
# - clicking yes a lot of times in a fast manner strangely seems to dismiss the dialog after a while
# Python 3.14.0 | Toga 0.5.3 | Darwin 25.2.0
return await self.dialog(question_dialog)
app = App()
app.main_loop()
```
### Screenshots
_No response_
### Environment details
Python 3.14.0
Toga 0.5.3
~~Darwin 25.2.0~~ macOS 26
### Logs
```
```
### Additional context
_No response_
Contributor guide
Research direction
Start with the provided minimal example and reproduce the problem on macOS using Toga 0.5.3, focusing on App.on_exit() and the contrast between self.dialog() and self.main_window.dialog(). Trace the app-context dialog path and compare its dismissal handling with the window-context path. Done means the Yes and No buttons reliably dismiss the app dialog and return the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100