Resizing viewport to fullscreen causes white bars and other artifacts

When fullscreening the viewport, it might not be properly sized (some elements off screen) and white bars can appear (the white bar in the video below is on my right monitor)

Expected behavior

Proper fullscreen, no artifacts