Maximize window correctly for different backends

(not tested)