summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-03-27 09:19:57 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2018-03-27 15:37:56 +0200
commitfec7dc8d4b82cc9a60d8625f313ba12d926665b5 (patch)
treeafbf4d4a4d6eb4424954e102fe6a9095e3cc15ba
parent464d95eca4e2febc0268fe3833f0596bb4ced005 (diff)
tdf#93120: Avoid redraws when mouse enters tooltips (Win)
Change-Id: I3870f4fad0662d9f4b027ec307370291740b1d52 Reviewed-on: https://gerrit.libreoffice.org/51930 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--vcl/win/window/salframe.cxx26
1 files changed, 21 insertions, 5 deletions
diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx
index 57ac8512daf7..7d22f95260f3 100644
--- a/vcl/win/window/salframe.cxx
+++ b/vcl/win/window/salframe.cxx
@@ -64,6 +64,7 @@
#include <win/salobj.h>
#include <win/saltimer.h>
+#include <helpwin.hxx>
#include <impbmp.hxx>
#include <window.h>
#include <sallayout.hxx>
@@ -3042,17 +3043,32 @@ static bool ImplHandleMouseMsg( HWND hWnd, UINT nMsg,
SalData* pSalData = GetSalData();
if ( pSalData->mhWantLeaveMsg == hWnd )
{
+ // Mouse-Coordinates are relative to the screen
+ POINT aPt;
+ aPt.x = static_cast<short>(LOWORD(lParam));
+ aPt.y = static_cast<short>(HIWORD(lParam));
+ ScreenToClient(hWnd, &aPt);
+ if (const auto& pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin)
+ {
+ const tools::Rectangle& rHelpRect = pHelpWin->GetHelpArea();
+ if (rHelpRect.IsInside(Point(aPt.x, aPt.y)))
+ {
+ // We have entered a tooltip (help window). Don't call the handler here; it
+ // would launch the sequence "Mouse leaves the Control->Control redraws->
+ // Help window gets destroyed->Mouse enters the Control->Control redraws",
+ // which takes CPU and may flicker. Just destroy the help window and pretend
+ // we are still over the original window.
+ ImplDestroyHelpWindow(true);
+ bCall = false;
+ break;
+ }
+ }
pSalData->mhWantLeaveMsg = nullptr;
if ( pSalData->mpMouseLeaveTimer )
{
delete pSalData->mpMouseLeaveTimer;
pSalData->mpMouseLeaveTimer = nullptr;
}
- // Mouse-Coordinates are relative to the screen
- POINT aPt;
- aPt.x = static_cast<short>(LOWORD( lParam ));
- aPt.y = static_cast<short>(HIWORD( lParam ));
- ScreenToClient( hWnd, &aPt );
aMouseEvt.mnX = aPt.x;
aMouseEvt.mnY = aPt.y;
aMouseEvt.mnButton = 0;