From eb0b7c1381bad21215337e70a626d8c5a76b77fc Mon Sep 17 00:00:00 2001 From: Sergey Guralnik Date: Thu, 6 Jun 2013 09:12:13 +0300 Subject: Revert "user32: Add the parameter bStatic in MDI_GetWindow to select the using child list (eterbug #1129 #2409)" (eterbug #9212) This reverts commit ce7d186ffa619cf01e0b79d74df239a00010d7ed. Conflicts: dlls/user32/mdi.c --- dlls/user32/mdi.c | 27 +++++++-------------------- 1 files changed, 7 insertions(+), 20 deletions(-) diff --git a/dlls/user32/mdi.c b/dlls/user32/mdi.c index 0740744..9285dac 100644 --- a/dlls/user32/mdi.c +++ b/dlls/user32/mdi.c @@ -234,7 +234,7 @@ static BOOL is_close_enabled(HWND hwnd, HMENU hSysMenu) * returns "activatable" child different from the current or zero */ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext, - DWORD dwStyleMask, BOOL bStatic ) + DWORD dwStyleMask ) { int i; HWND *list; @@ -243,13 +243,7 @@ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext, dwStyleMask |= WS_DISABLED | WS_VISIBLE; if( !hWnd ) hWnd = clientInfo->hwndActiveChild; - if(bStatic) - { - if (!(list = clientInfo->child)) return 0; - } - else - if (!(list = WIN_ListChildren( GetParent(hWnd) ))) return 0; - + if (!(list = WIN_ListChildren( GetParent(hWnd) ))) return 0; i = 0; /* start from next after hWnd */ while (list[i] && list[i] != hWnd) i++; @@ -259,12 +253,6 @@ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext, { if (GetWindow( list[i], GW_OWNER )) continue; if ((GetWindowLongW( list[i], GWL_STYLE ) & dwStyleMask) != WS_VISIBLE) continue; - if (hWnd == list[i]) continue; - - /* Check the case then MDI child window have - * other attached child window - */ - if (GetParent( hWnd ) != GetParent( list[i] )) continue; last = list[i]; if (bNext) goto found; } @@ -277,8 +265,7 @@ static HWND MDI_GetWindow(MDICLIENTINFO *clientInfo, HWND hWnd, BOOL bNext, if (bNext) goto found; } found: - if(!bStatic) - HeapFree( GetProcessHeap(), 0, list ); + HeapFree( GetProcessHeap(), 0, list ); return last; } @@ -569,7 +556,7 @@ static LRESULT MDIDestroyChild( HWND client, MDICLIENTINFO *ci, if( child == ci->hwndActiveChild ) { - HWND next = MDI_GetWindow(ci, child, TRUE, 0, FALSE); + HWND next = MDI_GetWindow(ci, child, TRUE, 0); /* flagDestroy == 0 means we were called from WM_PARENTNOTIFY handler */ if (flagDestroy && next) MDI_SwitchActiveChild(ci, next, TRUE); @@ -1211,8 +1198,8 @@ LRESULT MDIClientWndProc_common( HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_MDINEXT: /* lParam != 0 means previous window */ { - HWND next = MDI_GetWindow( ci, WIN_GetFullHandle( (HWND)wParam ), !lParam, 0, TRUE ); - MDI_ChildActivate( hwnd, next ); + HWND next = MDI_GetWindow( ci, WIN_GetFullHandle( (HWND)wParam ), !lParam, 0 ); + MDI_SwitchActiveChild( ci, next, TRUE ); break; } @@ -1608,7 +1595,7 @@ LRESULT WINAPI DefMDIChildProcW( HWND hwnd, UINT message, if( wParam == SIZE_MINIMIZED ) { - HWND switchTo = MDI_GetWindow( ci, hwnd, TRUE, WS_MINIMIZE, FALSE ); + HWND switchTo = MDI_GetWindow( ci, hwnd, TRUE, WS_MINIMIZE ); if (!switchTo) switchTo = hwnd; SendMessageW( switchTo, WM_CHILDACTIVATE, 0, 0 ); -- 1.7.0.4