I found a workaround. By setting the main Window’s content_scale_size
to 0, 0 the node sizes always match the window size.
I added this to _ready():
if get_window().mode == Window.MODE_WINDOWED:
get_window().content_scale_size = Vector2(0, 0)
Though take note that this messes up the scaling of CanvasItems outside the 3D Viewport, so this solution was not suitable for me.
What I ended up doing was ditching the whole SubViewportContainer
and working with a TextureRect
and a ViewportTexture
instead. This is a little more work but allows for more control over the Subviewport.
Hope this helps someone else!