Skip to content

App freeze and crash when exiting presentation mode #77

@ncoghlan

Description

@ncoghlan

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA crash or error in behavior.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions