App freeze and crash when exiting presentation mode
- Dominant language
- JavaScript
- Stars
- 211
- Forks
- 36
- Avg merge
- 6h 49m
- Merged PRs (30d)
- 1
Description
### Describe the bug
This is primarily about the last issue noted below, but also recording some other UX comments for things that didn't result in any obvious console logs.
1. Menu bar seems to be on the wrong screen in editing mode (but that may just be the way podium works, since the slide window is the main window, and the notes window is the secondary window)
2. The "Save" and "Save as" menu options didn't appear to do anything (the "Open" menu option brought up a file picker as expected)
3. It wasn't clear if the +/- buttons in the notes window were doing anything
4. When entering presentation mode, the speaker notes window went to full screen instead of the slides window
5. Entering presentation mode, then moving the speaker window around (including to a different screen), then attempting to exit presentation mode locked up podium until it eventually crashed with a "maximum recursion depth exceeded" (start and end of that traceback is in the logs below)
### Steps to reproduce
1. ~~Open the demo presentation~~ Run `briefcase dev` (although it does still happen after opening the demo presentation)
2. Enter presentation mode (via Ctrl-Shift-P or the menu)
3. Hit Esc to make the slide window full screen
4. Hit Esc to exit full screen & presentation mode (and fail to do so)
Edit: improved the description of the reproduction steps after some further experimentation
### Expected behavior
Esc exits presentation mode without triggering a recursive loop
### Screenshots
_No response_
### Environment
- Operating System: Fedora 41
- Python version: 3.13.7
- Software versions:
- See details in #76
### Logs
Start of traceback:
```
Toggle full screen
Toggle full screen
Toggle full screen
Goto next slide
Goto previous slide
Goto previous slide
Toggle full screen
Toggle full screen
Goto next slide
Goto previous slide
Goto next slide
Goto next slide
Goto previous slide
Toggle full screen
Traceback (most recent call last):
File "/home/ncoghlan/devel/podium/src/podium/deck.py", line 21, in gtk_key_press_event
widget.interface.app.stop(None)
~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
File "/home/ncoghlan/devel/podium/src/podium/app.py", line 141, in stop
self.current_window.doc.toggle_full_screen()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/devel/podium/src/podium/deck.py", line 226, in toggle_full_screen
self.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
```
End of traceback:
```
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
^C window._impl.set_window_state(WindowState.NORMAL)
Stopping...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 342, in set_window_state
self.interface.app.exit_presentation_mode()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/app.py", line 872, in exit_presentation_mode
window._impl.set_window_state(WindowState.NORMAL)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 337, in set_window_state
if any(
~~~^
window.state == WindowState.PRESENTATION
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
and window != self.interface
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
for window in self.interface.app.windows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
):
^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 338, in
window.state == WindowState.PRESENTATION
^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga/window.py", line 562, in state
return self._impl.get_window_state(in_progress_state=True)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/ncoghlan/.local/share/pipx/venvs/briefcase/lib64/python3.13/site-packages/toga_gtk/window.py", line 299, in get_window_state
if flags & Gdk.WindowState.MAXIMIZED:
~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
File "/usr/lib64/python3.13/enum.py", line 1608, in __and__
other_value = self._get_value(other)
RecursionError: maximum recursion depth exceeded
```
### Additional context
_No response_
Contributor guide
Research direction
Start with src/podium/deck.py at gtk_key_press_event and toggle_full_screen, then inspect src/podium/app.py at stop. Run briefcase dev and reproduce the presentation-mode and Esc sequence, using the Toga app.py and toga_gtk/window.py traceback to trace the recursion. Done means Esc exits presentation mode without locking up or raising RecursionError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 58/100