From dbd0de41c96081833a1eeff4317824c73abf16a2 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 29 Nov 2007 00:59:23 +0000 Subject: [PATCH] pull up r20164 from trunk r20164@cathode-dark-space: jaltman | 2007-11-14 17:34:53 -0500 ticket: 5842 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 version_fixed: 1.6.4 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-6@20172 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/identity/ui/mainwnd.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) 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; } -- 2.26.2