summaryrefslogtreecommitdiff
path: root/vcl/win
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-12 08:46:39 +0200
commit0d5fcb9abdead51a55f1f611d59fd0128ace57a8 (patch)
tree2f9376c6e4c7e99d8d970eb5dc9e58ff589139bd /vcl/win
parent4ca5c021c91680f1a5df47225d9cb0d41c0a8637 (diff)
Fix dropdown mispositioned
Only skip the relative positioning when the window is indeed a dialog. Follow up fix for a49245e04d45735aa76ad7720657c83530ba9ed8 Change-Id: Idbd8327a943c512f0a617cb0ca72e9caeb2e61e3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139204 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'vcl/win')
-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 1335c61ad170..c16a8fd2e8d1 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -1257,13 +1257,16 @@ void WinSalFrame::SetPosSize( tools::Long nX, tools::Long nY, tools::Long nWidth
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 )