better cross platform fullscreen toggling

pinched from emacs 24.4