I have a grid that runs a function to scale/position any new elements offset to the center of the viewport/window. If I change the window size while the program is running, such as maximizing, suddenly any new elements are offset offscreen or just in a place they are not supposed to be. I'm attempting to check when the window is resized and then loop through the grid's array and update all of their positions based on the new viewport/window size but I cannot get the signals to emit correctly.
I've tried these three options (separately):
get_window().size_changed.connect(Callable(self, "window_size_changed"))
get_tree().get_root().size_changed.connect(Callable(self, "window_size_changed"))
get_viewport().connect("size_changed", window_size_changed)
and none of them throw errors but none of them emit a signal when the size changes. I've tried force emitting the signal (using emit_signal) and the function works properly and prints my debug message.
This might not even be the right way to fix the positioning issue I'm having, but I am for sure misunderstanding something here