podium icon indicating copy to clipboard operation
podium copied to clipboard

App freeze and crash when exiting presentation mode

Open ncoghlan opened this issue 3 months ago • 2 comments

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

ncoghlan avatar Oct 06 '25 05:10 ncoghlan

Thanks for the report. Not sure of the cause of this one - it looks like it might be a race condition in the handling of GTK window state changes. More investigation is definitely required.

freakboy3742 avatar Oct 06 '25 23:10 freakboy3742

Noting the workaround that applies even after triggering the recursion: alt-tab to the console window and Ctrl-C that.

So exiting is a bit odd, but other than that everything essential seems to be working.

ncoghlan avatar Oct 07 '25 15:10 ncoghlan