mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:59:15 +02:00
carbon: fix incorrect mouseup emulation. (mouseup was reported even if mousebutton was not released)
git-svn-id: trunk@26842 -
This commit is contained in:
parent
c3c6eb4583
commit
fc4c35c78e
@ -227,6 +227,7 @@ begin
|
||||
|
||||
ActionUPP := NewControlActionUPP(@CarbonCommon_TrackProgress);
|
||||
try
|
||||
|
||||
if OSError(
|
||||
SetEventParameter(AEvent, kEventParamControlAction, typeControlActionUPP,
|
||||
SizeOf(ActionUPP), @ActionUPP), SName, SSetEvent, SControlAction) then Exit;
|
||||
@ -234,14 +235,17 @@ begin
|
||||
// this does not return until the mouse is released
|
||||
LastMousePos := AWidget.GetMousePos;
|
||||
Result := CallNextEventHandler(ANextHandler, AEvent);
|
||||
|
||||
if OSError(
|
||||
SetEventParameter(AEvent, kEventParamControlAction, typeControlActionUPP,
|
||||
SizeOf(OldActionUPP), @OldActionUPP), SName, SSetEvent, SControlAction) then Exit;
|
||||
finally
|
||||
DisposeControlActionUPP(ActionUPP);
|
||||
end;
|
||||
|
||||
|
||||
// if button state has not changed, then there's no need to emulate mouse up
|
||||
// because the button has not yet been released!
|
||||
if MouseButton=GetCurrentEventButtonState then Exit;
|
||||
|
||||
FillChar(Msg, SizeOf(Msg), 0);
|
||||
|
||||
if (MouseButton >= Low(MSGKIND)) and (MouseButton <= High(MSGKIND)) then
|
||||
|
Loading…
Reference in New Issue
Block a user