Fix emacs mode

fix typo which was setting vim mode instead of emacs
do not loose window position after closing minimized window on windows
close empty window when filepicker is canceled