From: Jeffrey Altman Date: Wed, 14 Nov 2007 22:34:53 +0000 (+0000) Subject: The khm_show_main_window() function is no longer called X-Git-Tag: krb5-1.7-alpha1~777 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a480b543fefd084131f1ff2c9f1e7e42f5edcfba;p=krb5.git The khm_show_main_window() function is no longer called at startup with khm_nCmdShow == SW_SHOWMINIMIZED in order to hide the main application by calling khm_hide_main_window(). Instead, the main application window is simply never shown. As a result, khm_show_main_window() needs to respond to khm_nCmdShow == SW_SHOWMINIMIZED not by hiding the window but by changing the khm_nCmdShow state to SW_SHOW and then calling ShowWindow(). This change will address the problem whereby "Show NIM Window" had to be triggered twice by the user when the process was started in a minimized state. ticket: 5842 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20164 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/windows/identity/ui/mainwnd.c b/src/windows/identity/ui/mainwnd.c index 42fcd193c..6802cd257 100644 --- a/src/windows/identity/ui/mainwnd.c +++ b/src/windows/identity/ui/mainwnd.c @@ -1212,18 +1212,29 @@ khm_show_main_window(void) { if (hw != khm_hwnd_main) SetForegroundWindow(khm_hwnd_main); } - - if (khm_nCmdShow == SW_SHOWMINIMIZED || + /* + * We test for the values of khm_nCmdShow that + * can be set at process startup. They will + * only be seen the first time this function is + * called. After the first time, the value of + * khm_nCmdShow will always be SW_RESTORE. + * When one of the minimized values is set, + * khm_show_main_window() will not be called + * unless the user initiates a request to show + * the window. + */ + else if (khm_nCmdShow == SW_SHOWMINIMIZED || khm_nCmdShow == SW_SHOWMINNOACTIVE || khm_nCmdShow == SW_MINIMIZE) { - khm_hide_main_window(); - } else { - ShowWindow(khm_hwnd_main, khm_nCmdShow); - UpdateWindow(khm_hwnd_main); - khm_cred_refresh(); + khm_nCmdShow = SW_SHOW; } + ShowWindow(khm_hwnd_main, khm_nCmdShow); + UpdateWindow(khm_hwnd_main); + + khm_cred_refresh(); + khm_nCmdShow = SW_RESTORE; }