Tested versions
- Reproducible in both 4.6.3 stable, and 4.7 stable.
System information
Godot v4.7.stable - Linux Mint 22.2 (Zara) on X11 - X11 display driver, Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti (nvidia; 595.71.05) - AMD Ryzen 7 5800X 8-Core Processor (16 threads) - 31.24 GiB memory - PulseAudio (44100 Hz, Stereo/mono)
Issue description
When using size_changed on the main window, either via get_viewport().get_window() or get_tree().root, its size_changed signal only gets called if its content_scale_aspect is set to CONTENT_SCALE_ASPECT_EXPAND. I assume this may be because it only calls it if the actual viewport inside gets resized, instead of the window. However, using get_window() or root, explicitly returns the WINDOW, therefore, if the window itself gets resized, it should emit the signal, regardless of the size of the viewport, it contains.
Steps to reproduce
- connect a dummy function to
get_tree().root.size_changed
- resize the window, while both content_scale_aspect is set to
CONTENT_SCALE_ASPECT_EXPAND and then any other setting
- observe how the signal only gets called, while
CONTENT_SCALE_ASPECT_EXPAND is set, as the current windows content_scale.
Minimal reproduction project (MRP)
size_changed is a lie.zip
Tested versions
System information
Godot v4.7.stable - Linux Mint 22.2 (Zara) on X11 - X11 display driver, Multi-window, 3 monitors - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 Ti (nvidia; 595.71.05) - AMD Ryzen 7 5800X 8-Core Processor (16 threads) - 31.24 GiB memory - PulseAudio (44100 Hz, Stereo/mono)
Issue description
When using size_changed on the main window, either via
get_viewport().get_window()orget_tree().root, itssize_changedsignal only gets called if its content_scale_aspect is set toCONTENT_SCALE_ASPECT_EXPAND. I assume this may be because it only calls it if the actual viewport inside gets resized, instead of the window. However, using get_window() or root, explicitly returns the WINDOW, therefore, if the window itself gets resized, it should emit the signal, regardless of the size of the viewport, it contains.Steps to reproduce
get_tree().root.size_changedCONTENT_SCALE_ASPECT_EXPANDand then any other settingCONTENT_SCALE_ASPECT_EXPANDis set, as the current windows content_scale.Minimal reproduction project (MRP)
size_changed is a lie.zip