]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
call Create from wxGrid non-default ctor instead to ensure both methods of creation...
[wxWidgets.git] / src / msw / toplevel.cpp
index 8a22cb54a1476a0c2aa53480969f4cdaee872d3d..d0e47ea963779007705bf202e56f843aff7608f3 100644 (file)
@@ -660,10 +660,14 @@ bool wxTopLevelWindowMSW::Show(bool show)
         }
         else // just show
         {
         }
         else // just show
         {
-           if ( GetWindowStyle() & wxFRAME_TOOL_WINDOW )
-               nShowCmd = SW_SHOWNA;
-           else
-               nShowCmd = SW_SHOW;
+            // we shouldn't use SW_SHOW which also activates the window for
+            // tool frames (as they shouldn't steal focus from the main window)
+            // nor for the currently disabled windows as they would be enabled
+            // as a side effect
+            if ( HasFlag(wxFRAME_TOOL_WINDOW) || !IsEnabled() )
+                nShowCmd = SW_SHOWNA;
+            else
+                nShowCmd = SW_SHOW;
         }
     }
     else // hide
         }
     }
     else // hide