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 flickering in embedded game when paused #102006

Merged
merged 1 commit into from
Jan 28, 2025

Conversation

Hilderin
Copy link
Contributor

This PR should fix the flickering and artefacts when the embedded game is resized for a larger size when the game is paused. This is caused by the fact that Godot does not rerender when the game is paused, which is expected.

Although I was unable to reproduce the flickering on my computer, I did observe artifacts when the game was paused and the window was resized to a larger size.

To prevent these artifacts and hopefully the flickering, I have implemented a solution that saves the size of the embedded game when the pause is activated. This saved size is then set as a fixed size in the embedded process control to ensure the game window never becomes larger.

I also fixed another issue related to pause mode. When the game was paused, closing the floating window did not complete until the game was unpaused. This issue occurred because the close message sent to the window was not processed.

Additionally, I discovered another minor, unrelated issue. If the last selected tab was Game when the editor was launched, and the game was started with the floating window enabled, a blank main screen would appear in the editor. The content of the Game tab was transferred to the floating window, but the tab (main screen) was not changed for another editor.

@Hilderin Hilderin added this to the 4.4 milestone Jan 25, 2025
@AThousandShips AThousandShips requested a review from a team January 25, 2025 09:25
Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

Was not able to reproduce the flickering, but changes look reasonable, and I have not encountered any issues while testing it.

@Hilderin Hilderin force-pushed the fix-embedded-game-paused branch from dadbacc to 3580509 Compare January 27, 2025 21:22
@Repiteo Repiteo merged commit 108e662 into godotengine:master Jan 28, 2025
19 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Jan 28, 2025

Thanks!

@JekSun97
Copy link
Contributor

@Hilderin Unfortunately the problem still appears, I noticed that this problem only occurs when running a 2D scene, when running a 3D scene I can't produce the problem, to check this, run a 2D scene, press pause, minimize the editor window, and expand, you should see a black square that is not cleared.
123
1233

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Horrible Flickering when closing docks while embedded game is paused
5 participants