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: [Windows] OpenTTD window may be inactive when an error happens #7482

Merged
merged 1 commit into from Apr 7, 2019

Conversation

glx22
Copy link
Contributor

@glx22 glx22 commented Apr 7, 2019

If OpenTTD window is inactive when a message box is displayed then input for OpenTTD window are not blocked, and subsequent message boxes are linked to the last displayed message box. If the error happens in a section of code where _local_company != _current_company the assert in HandleMouseEvents() will be triggered if mouse moves over OpenTTD window and there will be flood with message boxes. Using MB_TASKMODAL prevents that.

Another option would be to use _wnd.main_hwnd from win32 video driver.

Copy link
Member

@PeterN PeterN left a comment

Choose a reason for hiding this comment

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

Modal seems correct as OpenTTD does not expect to return if it has shown an error window.

@glx22 glx22 merged commit 3e608af into OpenTTD:master Apr 7, 2019
@glx22 glx22 deleted the message_box branch April 7, 2019 19:52
@glx22 glx22 added the backport requested This PR should be backport to current release (RC / stable) label Apr 7, 2019
@PeterN PeterN added backported This PR is backported to a current release (RC / stable) and removed backport requested This PR should be backport to current release (RC / stable) labels Apr 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported This PR is backported to a current release (RC / stable)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants