From 1783c8195e8d47e2b567aaec2b2e39472666e380 Mon Sep 17 00:00:00 2001 From: tombo Date: Wed, 5 Mar 2008 17:03:39 +0000 Subject: [PATCH] LCL Carbon: fixed 0010872: Block select on the Carbon IDE doesn't work as expected mouse moves are called only when there is really some change git-svn-id: trunk@14435 - --- lcl/interfaces/carbon/carbonprivate.pp | 3 +++ lcl/interfaces/carbon/carbonprivatecommon.inc | 4 ++++ 2 files changed, 7 insertions(+) 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