Skip to content

Handle exiting when pause_when_inactive = true#3079

Merged
kcgen merged 1 commit intomainfrom
wd/pause
Nov 2, 2023
Merged

Handle exiting when pause_when_inactive = true#3079
kcgen merged 1 commit intomainfrom
wd/pause

Conversation

@weirddan455
Copy link
Copy Markdown
Collaborator

@weirddan455 weirddan455 commented Nov 2, 2023

Description

Quick fix for a bug I just encountered. To reproduce:

  1. In the config file under [sdl], set pause_when_inactive=true (this setting does not properly change at runtime, must be set in config).
  2. Unfocus the Dosbox window
  3. Click the X to close the window
  4. Dosbox will not close until the window is re-focused

This fix simply checks if shutdown has been requested and, if so, breaks out of the "pause loop". This is the same way that the PauseDOSBox function handles this. PauseDOSBox is the code that gets run when you press ALT+Pause on the keyboard. pause_when_inactive is handled separately in the code touched by this PR.

Related issues

No known issues filed. Was quicker for me to just make this PR.

Manual testing

Followed repo steps above and confirmed this fixes the issue. Also confirmed the pausing functionality still works.

Checklist

Please tick the items as you have addressed them. Don't remove items; leave the ones that are not applicable unchecked.

I have:

  • followed the project's contributing guidelines and code of conduct.
  • performed a self-review of my code.
  • commented on the particularly hard-to-understand areas of my code.
  • split my work into well-defined, bisectable commits, and I named my commits well.
  • applied the appropriate labels (bug, enhancement, refactoring, documentation, etc.)
  • checked that all my commits can be built.
  • confirmed that my code does not cause performance regressions (e.g., by running the Quake benchmark).
  • added unit tests where applicable to prove the correctness of my code and to avoid future regressions.
  • made corresponding changes to the documentation or the website according to the documentation guidelines.
  • locally verified my website or documentation changes.

Fixes a bug where the Dosbox window will not close while the window is
inactive and Dosbox is paused.
@weirddan455 weirddan455 added the bug Something isn't working label Nov 2, 2023
@weirddan455 weirddan455 self-assigned this Nov 2, 2023
Copy link
Copy Markdown
Member

@kcgen kcgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@kcgen kcgen merged commit baea782 into main Nov 2, 2023
@weirddan455 weirddan455 deleted the wd/pause branch November 2, 2023 18:12
@johnnovak johnnovak changed the title Handle exiting when pause_when_inactive=true Handle exiting when pause_when_inactive = true Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants