Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11115: Focus the abandon game/exit game windows #11125

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

merni-ns
Copy link
Contributor

@merni-ns merni-ns commented Jul 10, 2023

Motivation / Problem

Fixes #11115.

Description

  • Add a parameter to ShowQuery which gives focus to the query window created by the function. By default it is false to preserve current behaviour.
  • Use that parameter to focus the "Abandon game" and "Exit game" confirmation queries.
  • Also, the query created by ShowQuery is not modal even though it is described as modal by the comment. So that comment is fixed.

Limitations

Opening the abandon/exit query windows will now remove focus on whatever window is currently focussed.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR touches english.txt or translations? Check the guidelines
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Copy link
Member

@2TallTyler 2TallTyler left a comment

Choose a reason for hiding this comment

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

We could probably bikeshed about what other windows could or should be focused...but let's not. The new default parameter is a nice way to handle this, I think.

src/misc_gui.cpp Show resolved Hide resolved
@TrueBrain TrueBrain merged commit fc9afb2 into OpenTTD:master Jul 14, 2023
19 checks passed
@merni-ns merni-ns deleted the 11115 branch October 1, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview This PR is receiving preview builds
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Window focus for keyboard shortcuts doesn't respect draw order/priority of windows
3 participants