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 <sarper.akdemir.extern@allotropia.de>
This commit is contained in:
Sarper Akdemir
2023-07-17 10:09:04 +02:00
parent 2b3a950e93
commit dc5163af16
+8 -1
View File
@@ -1590,7 +1590,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 );