Merge pull request #51973 from Calinou/define-minimum-window-size-3.x

Define a default minimum window size to workaround rendering issues (3.x)
This commit is contained in:
Hugo Locurcio 2021-08-23 04:10:55 +02:00 committed by GitHub
commit 2370fe5c26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -939,7 +939,8 @@
The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value.
</member>
<member name="min_window_size" type="Vector2" setter="set_min_window_size" getter="get_min_window_size" default="Vector2( 0, 0 )">
The minimum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system default value.
The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to [code](0, 0)[/code] to reset to the system's default value.
[b]Note:[/b] By default, the project window has a minimum size of [code]Vector2(64, 64)[/code]. This prevents issues that can arise when the window is resized to a near-zero size.
</member>
<member name="screen_orientation" type="int" setter="set_screen_orientation" getter="get_screen_orientation" enum="_OS.ScreenOrientation" default="0">
The current screen orientation.

View File

@ -1878,6 +1878,10 @@ bool Main::start() {
OS::get_singleton()->set_window_title(appname);
#endif
// Define a very small minimum window size to prevent bugs such as GH-37242.
// It can still be overridden by the user in a script.
OS::get_singleton()->set_min_window_size(Size2(64, 64));
int shadow_atlas_size = GLOBAL_GET("rendering/quality/shadow_atlas/size");
int shadow_atlas_q0_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_0_subdiv");
int shadow_atlas_q1_subdiv = GLOBAL_GET("rendering/quality/shadow_atlas/quadrant_1_subdiv");