From 0599dc51aa89d7aa1d81f6b48068e1224e395f96 Mon Sep 17 00:00:00 2001 From: martin Date: Thu, 13 Aug 2009 14:10:09 +0000 Subject: [PATCH] LCL: small optimization to WM_SETCURSOR, avoid unnecessary calculations, if screen.cursor is set git-svn-id: trunk@21217 - --- lcl/interfaces/win32/win32callback.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lcl/interfaces/win32/win32callback.inc b/lcl/interfaces/win32/win32callback.inc index d26f615bef..29517a7ccd 100644 --- a/lcl/interfaces/win32/win32callback.inc +++ b/lcl/interfaces/win32/win32callback.inc @@ -795,17 +795,17 @@ var if (lWinControl <> nil) and not (csDesigning in lWinControl.ComponentState) and (LOWORD(LParam) = HTCLIENT) then begin - Windows.GetCursorPos(Windows.POINT(P)); - Windows.ScreenToClient(Window, Windows.POINT(P)); - if GetLCLClientBoundsOffset(lWinControl, BoundsOffset) then - begin - Dec(P.X, BoundsOffset.Left); - Dec(P.Y, BoundsOffset.Top); - end; ACursor := Screen.Cursor; if ACursor = crDefault then begin - // statictext controls do not get WM_SETCURSOR messages... + Windows.GetCursorPos(Windows.POINT(P)); + Windows.ScreenToClient(Window, Windows.POINT(P)); + if GetLCLClientBoundsOffset(lWinControl, BoundsOffset) then + begin + Dec(P.X, BoundsOffset.Left); + Dec(P.Y, BoundsOffset.Top); + end; + // TGraphicControl controls do not get WM_SETCURSOR messages... lControl := lWinControl.ControlAtPos(P, [capfOnlyClientAreas, capfAllowWinControls, capfHasScrollOffset, capfRecursive]); if lControl = nil then