This patch is functionally correct. There are some style issues: (1) I prefer main_wnd_save_sizepos() to be static since it is not used outside the source file. (2) I prefer that main_wnd_save_sizepos() not be called from within khm_set_main_window_mode() if the main application window has not been created. (3) the reason that main_wnd_save_sizepos() must be called before khm_main_wnd_mode is updated is subtle and should be documented. I will move this ticket to the krb5 queue and then commit the patch with my style changes.