Skip to content

Closing a modal window does not restore the focus on top level window

Originally posted: https://github.com/audacity/audacity/issues/8282

Issue description:

When the application opens a modal dialog and, upon its closure, immediately spawns another modal (a progress dialog in our case) that closes almost instantly due to a short operation, the main window does not regain focus. As a result, it stops receiving keyboard input.

The issue was introduced with this fix: !136 (merged)

Steps to reproduce:

  • Open Audacity
  • Select "Generate\Chirp" and create a 1 second chirp
  • Press "spacebar" observe that keyboard input is working
  • Select "Generate\Chirp" and create a 1 second chirp again
  • Press "spacebar" observe that keyboard input is not working