vcl/win/window/salframe.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 44d41ab98f5210a37cbcd04819a38c08a01464d4 Author: Sarper Akdemir <[email protected]> AuthorDate: Fri Jul 14 18:04:35 2023 +0300 Commit: Sarper Akdemir <[email protected]> CommitDate: Tue Jul 18 10:55:17 2023 +0200 tdf#90023: vcl: fix tooltip displaying over two monitors on Windows To determine the WorkArea correctly in ImplSalGetWorkArea, pass in the mouse pointer as pParentRect. Similarly to how it has been done on: vcl/win/window/salframe.cxx:1393 Change-Id: I43123be315c5ea146c118e8e2a582ceaaab0a35e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154442 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <[email protected]> (cherry picked from commit dc5163af166cb2afb9811dbf0443e1fcceafbb9a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154463 Reviewed-by: Thorsten Behrens <[email protected]> (cherry picked from commit 2d3892f2bc51390825d6775c5f193c4864005a06) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154466 diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 5f1961a7f5d6..6ab7bc61d673 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -1595,7 +1595,14 @@ void WinSalFrame::SetPluginParent( SystemParentData* pNewParent ) void WinSalFrame::GetWorkArea( tools::Rectangle &rRect ) { RECT aRect; - ImplSalGetWorkArea( mhWnd, &aRect, nullptr ); + + // pass cursor's position to ImplSalGetWorkArea to determine work area on + // multi monitor setups correctly. + POINT aPoint; + GetCursorPos(&aPoint); + RECT aRect2{ aPoint.x, aPoint.y, aPoint.x + 2, aPoint.y + 2 }; + + ImplSalGetWorkArea( mhWnd, &aRect, &aRect2 ); rRect.SetLeft( aRect.left ); rRect.SetRight( aRect.right-1 ); rRect.SetTop( aRect.top );
