pull up r20164 from trunk
authorTom Yu <tlyu@mit.edu>
Thu, 29 Nov 2007 00:59:23 +0000 (00:59 +0000)
committerTom Yu <tlyu@mit.edu>
Thu, 29 Nov 2007 00:59:23 +0000 (00:59 +0000)
 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

index 42fcd193c39675961f7b3b3143fb7a32545041a1..6802cd25702713cd292d1de4c3f07b4a1a919f17 100644 (file)
@@ -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;
 }