vcl/win/window/salframe.cxx |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit dc5163af166cb2afb9811dbf0443e1fcceafbb9a
Author:     Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
AuthorDate: Fri Jul 14 18:04:35 2023 +0300
Commit:     Sarper Akdemir <sarper.akdemir.ext...@allotropia.de>
CommitDate: Mon Jul 17 10:09:04 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 <sarper.akdemir.ext...@allotropia.de>

diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 2e60f38c1f11..c911fff0840f 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -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 );

Reply via email to