]> git.saurik.com Git - wxWidgets.git/commitdiff
Switch deferred sizing off by default
authorJulian Smart <julian@anthemion.co.uk>
Thu, 24 Mar 2005 09:28:51 +0000 (09:28 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Thu, 24 Mar 2005 09:28:51 +0000 (09:28 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/latex/wx/sysopt.tex
src/msw/window.cpp

index 91ffd8eba42ccced16509b1198a231b20f9b5c45..d4c091388eb90b02062ff8caf8d20c08469e39db 100644 (file)
@@ -28,6 +28,8 @@ pages).}
 \twocolitem{msw.staticbitmap.htclient}{If set to 1, allows the static bitmap to respond to mouse
 events. The default is 0, since a value of 1 can interfere with refresh in static boxes. Note that once set,
 this option cannot be unset later in the application.}
+\twocolitem{msw.window.defersize}{If set to 1, optimizes window sizing and positioning when a size event is
+received. This can occasionally have unwanted side-effects, so is off by default.}
 \end{twocollist}
 
 \wxheading{Mac}
index c332ba35effc6223edba8c3e93eb411442723db3..163c0df7ea012372749f0cbff4f4d716ef43c272 100644 (file)
@@ -1122,7 +1122,7 @@ void wxWindowMSW::SetWindowStyleFlag(long flags)
 
         ::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyleReal);
 
-        // we must call SetWindowPos() to flash the cached extended style and
+        // we must call SetWindowPos() to flush the cached extended style and
         // also to make the change to wxSTAY_ON_TOP style take effect: just
         // setting the style simply doesn't work
         if ( !::SetWindowPos(GetHwnd(),
@@ -1504,22 +1504,27 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
     if (height < 0)
         height = 0;
 
-    // if our parent had prepared a defer window handle for us, use it (unless
-    // we are a top level window)
-    wxWindowMSW *parent = GetParent();
-    HDWP hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL;
-    if ( hdwp )
+    HDWP hdwp = 0;
+    
+    if ( wxSystemOptions::GetOptionInt(wxT("msw.window.defersize")) == 1 )
     {
-        hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
+        // if our parent had prepared a defer window handle for us, use it (unless
+        // we are a top level window)
+        wxWindowMSW *parent = GetParent();
+        hdwp = (parent && !IsTopLevel()) ? (HDWP)parent->m_hDWP : NULL;
+        if ( hdwp )
+        {
+            hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
                                 x, y, width, height,
                                 SWP_NOZORDER);
-        if ( !hdwp )
-        {
-            wxLogLastError(_T("DeferWindowPos"));
-        }
+            if ( !hdwp )
+            {
+                wxLogLastError(_T("DeferWindowPos"));
+            }
 
-        // hdwp must be updated as it may have been changed
-        parent->m_hDWP = (WXHANDLE)hdwp;
+            // hdwp must be updated as it may have been changed
+            parent->m_hDWP = (WXHANDLE)hdwp;
+        }
     }
 
     // otherwise (or if deferring failed) move the window in place immediately
@@ -4105,10 +4110,13 @@ bool wxWindowMSW::HandleSize(int WXUNUSED(w), int WXUNUSED(h), WXUINT wParam)
     const int numChildren = GetChildren().GetCount();
     if ( numChildren > 1 )
     {
-        m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
-        if ( !m_hDWP )
+        if ( wxSystemOptions::GetOptionInt(wxT("msw.window.defersize")) == 1 )
         {
-            wxLogLastError(_T("BeginDeferWindowPos"));
+            m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
+            if ( !m_hDWP )
+            {
+                wxLogLastError(_T("BeginDeferWindowPos"));
+            }
         }
     }