reverted use of DeferWindowPos() instead of MoveWindow()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -422,10 +422,6 @@ protected:
|
|||||||
// the old window proc (we subclass all windows)
|
// the old window proc (we subclass all windows)
|
||||||
WXFARPROC m_oldWndProc;
|
WXFARPROC m_oldWndProc;
|
||||||
|
|
||||||
// the current multi-window move structure handle, NULL if window resize is
|
|
||||||
// not in process
|
|
||||||
WXHANDLE m_hDWP;
|
|
||||||
|
|
||||||
// additional (MSW specific) flags
|
// additional (MSW specific) flags
|
||||||
bool m_mouseInWindow:1;
|
bool m_mouseInWindow:1;
|
||||||
bool m_lastKeydownProcessed:1;
|
bool m_lastKeydownProcessed:1;
|
||||||
|
@@ -437,7 +437,6 @@ void wxWindowMSW::Init()
|
|||||||
m_frozenness = 0;
|
m_frozenness = 0;
|
||||||
|
|
||||||
m_hWnd = 0;
|
m_hWnd = 0;
|
||||||
m_hDWP = 0;
|
|
||||||
|
|
||||||
m_xThumbSize = 0;
|
m_xThumbSize = 0;
|
||||||
m_yThumbSize = 0;
|
m_yThumbSize = 0;
|
||||||
@@ -1532,29 +1531,9 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
|
|||||||
if (height < 0)
|
if (height < 0)
|
||||||
height = 0;
|
height = 0;
|
||||||
|
|
||||||
// if our parent had prepared a defer window handle for us, use it
|
if ( !::MoveWindow(GetHwnd(), x, y, width, height, TRUE) )
|
||||||
HDWP hdwp = m_parent ? (HDWP)m_parent->m_hDWP : NULL;
|
|
||||||
if ( hdwp )
|
|
||||||
{
|
{
|
||||||
hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
|
wxLogLastError(wxT("MoveWindow"));
|
||||||
x, y, width, height,
|
|
||||||
SWP_NOZORDER);
|
|
||||||
if ( !hdwp )
|
|
||||||
{
|
|
||||||
wxLogLastError(_T("DeferWindowPos"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// hdwp must be updated as it may have been changed
|
|
||||||
m_parent->m_hDWP = (WXHANDLE)hdwp;
|
|
||||||
}
|
|
||||||
|
|
||||||
// otherwise (or if deferring failed) move the window in place immediately
|
|
||||||
if ( !hdwp )
|
|
||||||
{
|
|
||||||
if ( !::MoveWindow(GetHwnd(), x, y, width, height, TRUE) )
|
|
||||||
{
|
|
||||||
wxLogLastError(wxT("MoveWindow"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2248,36 +2227,8 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l
|
|||||||
(void)HandleDestroy();
|
(void)HandleDestroy();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_WINDOWPOSCHANGING:
|
|
||||||
{
|
|
||||||
// when we resize this window, its children are probably going
|
|
||||||
// to be repositioned as well, prepare to use DeferWindowPos()
|
|
||||||
// for them
|
|
||||||
const int numChildren = GetChildren().GetCount();
|
|
||||||
if ( numChildren > 1 )
|
|
||||||
{
|
|
||||||
m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
|
|
||||||
if ( !m_hDWP )
|
|
||||||
{
|
|
||||||
wxLogLastError(_T("BeginDeferWindowPos"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
|
processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
|
||||||
|
|
||||||
if ( m_hDWP )
|
|
||||||
{
|
|
||||||
// put all child controls in place at once now
|
|
||||||
if ( !::EndDeferWindowPos((HDWP)m_hDWP) )
|
|
||||||
{
|
|
||||||
wxLogLastError(_T("EndDeferWindowPos"));
|
|
||||||
}
|
|
||||||
|
|
||||||
m_hDWP = NULL;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_MOVE:
|
case WM_MOVE:
|
||||||
|
Reference in New Issue
Block a user