mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 04:18:48 +02:00
LCL: small optimization to WM_SETCURSOR, avoid unnecessary calculations, if screen.cursor is set
git-svn-id: trunk@21217 -
This commit is contained in:
parent
af0b5a9727
commit
0599dc51aa
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user