How can I manually refresh the editor View?

I’m working on a Script to change the resolution.
Right now the script uses.

ProjectSettings.set_setting("display/window/size/viewport_width", width)			
ProjectSettings.set_setting("display/window/size/viewport_height", height)	

The issue is here.

The UI doesn’t refresh. The Only way I found to trigger a refresh is by using

var size = DisplayServer.window_get_size()
	# The only way to trigger the editor making a change
	# If the Editor is fullscreen there will no changes
	DisplayServer.window_set_size(Vector2i(size.x-1, size.y-1))	

But the only issue is when the editor is maximized or fullscreen. This doesn’t work

Check here: