Fixes #7075 We have to use private APIs for this, I couldn't find a reliable way otherwise.
reset_window_size