handle Ctrl-S for saving window state