summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2022-09-01 14:19:50 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2022-09-01 14:50:24 +0200
commitf2459542a3f0e18558c1bae583478a09a3698de3 (patch)
tree6b0c4c0e466c1d346e3e694bde1be842c8681d91 /vcl
parent5df5d4c179af34166f85f7cfa507cabe2d08f720 (diff)
Fix dropdown mispositioned
Only skip the relative positioning when the window is indeed a dialog. Follow up fix for a49245e04d45735aa76ad7720657c83530ba9ed8 Change-Id: Idbd8327a943c512f0a617cb0ca72e9caeb2e61e3
Diffstat (limited to 'vcl')
-rw-r--r--vcl/win/window/salframe.cxx11
1 files changed, 7 insertions, 4 deletions
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 )