Fix flickering in embedded game when paused #102006
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 theGame
tab was transferred to the floating window, but the tab (main screen) was not changed for another editor.