Skip to content

Window.size_changed signal does not get called, when content_scale_aspect is set to anything other than CONTENT_SCALE_ASPECT_EXPAND #120963

Description

@JHDev2006

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

  1. connect a dummy function to get_tree().root.size_changed
  2. resize the window, while both content_scale_aspect is set to CONTENT_SCALE_ASPECT_EXPAND and then any other setting
  3. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions