vcl/win/window/salframe.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
New commits: commit f2459542a3f0e18558c1bae583478a09a3698de3 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Thu Sep 1 14:19:50 2022 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Thu Sep 1 14:50:24 2022 +0200 Fix dropdown mispositioned Only skip the relative positioning when the window is indeed a dialog. Follow up fix for a49245e04d45735aa76ad7720657c83530ba9ed8 Change-Id: Idbd8327a943c512f0a617cb0ca72e9caeb2e61e3 diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index cdb18fcc25fb..4fb572fc19a9 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -1281,13 +1281,16 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight, nWidth = aWinRect.right - aWinRect.left + 1; nHeight = aWinRect.bottom - aWinRect.top + 1; + HWND hWndParent = ImplGetParentHwnd(mhWnd); // For dialogs (WS_POPUP && WS_DLGFRAME), we need to find the "real" parent, // in case multiple dialogs are stacked on each other - // (wo don't want to position the second dialog relative to the first one, but relative to the main window) - HWND hWndParent = ImplGetParentHwnd(mhWnd); - while ( hWndParent && (GetWindowStyle( hWndParent ) & WS_POPUP) && (GetWindowStyle( hWndParent ) & WS_DLGFRAME) ) + // (we don't want to position the second dialog relative to the first one, but relative to the main window) + if ( (GetWindowStyle( mhWnd ) & WS_POPUP) && (GetWindowStyle( mhWnd ) & WS_DLGFRAME) ) // mhWnd is a dialog { - hWndParent = ::ImplGetParentHwnd( hWndParent ); + while ( hWndParent && (GetWindowStyle( hWndParent ) & WS_POPUP) && (GetWindowStyle( hWndParent ) & WS_DLGFRAME) ) + { + hWndParent = ::ImplGetParentHwnd( hWndParent ); + } } if ( !(nPosSize & SWP_NOMOVE) && hWndParent )