mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-17 08:09:26 +02:00
LCL Carbon: finally find solution for #0011287: Mac OS X : Double Click when Showing forms does not work correctly... - postpone down message to start of mouse tracking
git-svn-id: trunk@16581 -
This commit is contained in:
parent
22aa8a9284
commit
56b2d3f9c3
@ -336,6 +336,10 @@ var PrevKeyModifiers: UInt32 = 0;
|
||||
// Stores mouse up message to be fired on control hit after value is updated
|
||||
var SavedMouseUpMsg: TLMMouse;
|
||||
|
||||
// Stores multi click mouse down message to be fired after handling standard event
|
||||
var PostponedDownMsg: TLMMouse;
|
||||
var PostponedDown: Boolean;
|
||||
|
||||
// Stores last mouse pos to call mouse move only when it really has changed
|
||||
var LastMousePos: TPoint;
|
||||
|
||||
|
@ -165,6 +165,13 @@ begin
|
||||
nil, SizeOf(ActionUPP), nil, @OldActionUPP), SName, SGetEvent,
|
||||
SControlAction) then Exit;
|
||||
|
||||
if PostponedDown then
|
||||
begin
|
||||
PostponedDown := False;
|
||||
NotifyApplicationUserInput(PostponedDownMsg.Msg);
|
||||
DeliverMessage(AWidget.LCLObject, PostponedDownMsg);
|
||||
end;
|
||||
|
||||
MouseButton := GetCarbonMouseButton(AEvent);
|
||||
|
||||
ActionUPP := NewControlActionUPP(@CarbonCommon_TrackProgress);
|
||||
|
@ -62,6 +62,7 @@ var
|
||||
// or the rootcontrol if none found
|
||||
Widget: TCarbonWidget; // the widget specific to the mouse event
|
||||
// or the window's widgetinfo if none found
|
||||
Postpone: Boolean;
|
||||
const
|
||||
SName = 'CarbonWindow_MouseProc';
|
||||
|
||||
@ -153,6 +154,8 @@ const
|
||||
Msg^.Keys := GetCarbonMsgKeyState;
|
||||
|
||||
CarbonWidgetSet.SetCaptureWidget(HWND(Widget));
|
||||
|
||||
if ClickCount > 1 then Postpone := True;
|
||||
end;
|
||||
|
||||
procedure HandleMouseUpEvent(var AMsg);
|
||||
@ -244,6 +247,7 @@ var
|
||||
ViewPart: HIViewPartCode;
|
||||
begin
|
||||
Result := EventNotHandledErr;
|
||||
Postpone := False;
|
||||
|
||||
// check window part code
|
||||
Part := inContent;
|
||||
@ -284,15 +288,24 @@ begin
|
||||
Exit(EventNotHandledErr);
|
||||
end;
|
||||
|
||||
// Msg is set in the Appropriate HandleMousexxx procedure
|
||||
NotifyApplicationUserInput(Msg.Message.Msg);
|
||||
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
|
||||
if Postpone then
|
||||
begin
|
||||
Result := EventNotHandledErr;
|
||||
PostponedDown := True;
|
||||
PostponedDownMsg := TLMMouse(Msg.Message);
|
||||
Result := CallNextEventHandler(ANextHandler, AEvent);
|
||||
end
|
||||
else // the LCL does not want the event propagated
|
||||
Result := noErr;
|
||||
|
||||
else
|
||||
begin
|
||||
// Msg is set in the Appropriate HandleMousexxx procedure
|
||||
NotifyApplicationUserInput(Msg.Message.Msg);
|
||||
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
|
||||
begin
|
||||
Result := EventNotHandledErr;
|
||||
end
|
||||
else // the LCL does not want the event propagated
|
||||
Result := noErr;
|
||||
end;
|
||||
|
||||
// interactive design
|
||||
if (Widget is TCarbonDesignWindow) and (GetCarbonMouseButton(AEvent) = 1) and
|
||||
(EventKind = kEventMouseDown) then
|
||||
|
Loading…
Reference in New Issue
Block a user