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 d3c673e: Don't defer OnResize() after ReInit() #12174

Merged
merged 1 commit into from Feb 25, 2024

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Feb 24, 2024

Motivation / Problem

Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the deferred resize event is handled on the next redraw.

Screencast.from.2024-02-24.22-29-30.webm

Description

Instead, call OnResize() directly within OnInit().

Screencast.from.2024-02-24.22-36-37.webm

Limitations

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, game_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
@PeterN PeterN added the backport requested This PR should be backport to current release (RC / stable) label Feb 24, 2024
@PeterN PeterN merged commit 8afef45 into OpenTTD:master Feb 25, 2024
20 checks passed
@PeterN PeterN deleted the fix-dirty-resize branch February 25, 2024 08:37
Kuhnovic pushed a commit to Kuhnovic/OpenTTD that referenced this pull request Mar 9, 2024
Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
michicc pushed a commit to Kuhnovic/OpenTTD that referenced this pull request Mar 9, 2024
Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
Kuhnovic pushed a commit that referenced this pull request Mar 11, 2024
Some windows resize themselves during painting and issue ReInit(). In this case deferred OnResize() causes a visible glitch as the event is handled on the next redraw.
@Kuhnovic Kuhnovic 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 Mar 11, 2024
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

3 participants