diff --git a/lcl/interfaces/carbon/carbonprivate.pp b/lcl/interfaces/carbon/carbonprivate.pp index d4c1932914..dbb1e03afb 100644 --- a/lcl/interfaces/carbon/carbonprivate.pp +++ b/lcl/interfaces/carbon/carbonprivate.pp @@ -334,6 +334,9 @@ var PrevKeyModifiers: UInt32 = 0; // Stores mouse up message to be fired on control hit after value is updated var SavedMouseUpMsg: TLMMouse; +// Stores last mouse pos to call mouse move only when it really has changed +var LastMousePos: TPoint; + {$I carbonprivatecommon.inc} {$I carbonprivatecontrol.inc} {$I carbonprivatewindow.inc} diff --git a/lcl/interfaces/carbon/carbonprivatecommon.inc b/lcl/interfaces/carbon/carbonprivatecommon.inc index 1486bdb567..7ab6aa3195 100644 --- a/lcl/interfaces/carbon/carbonprivatecommon.inc +++ b/lcl/interfaces/carbon/carbonprivatecommon.inc @@ -121,6 +121,8 @@ begin if Widget <> nil then begin P := Widget.GetMousePos; + if (LastMousePos.X = P.X) and (LastMousePos.Y = P.Y) then Exit; + LastMousePos := P; if Widget is TCarbonControl then if cceDoAction in (Widget as TCarbonControl).GetValidEvents then @@ -192,6 +194,8 @@ begin Msg.YPos := P.Y; Msg.Keys := GetCarbonMsgKeyState; + LastMousePos := P; + if (AWidget is TCarbonControl) and (cceHit in (AWidget as TCarbonControl).GetValidEvents) then begin