mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-02 04:00:25 +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
|
// Stores mouse up message to be fired on control hit after value is updated
|
||||||
var SavedMouseUpMsg: TLMMouse;
|
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
|
// Stores last mouse pos to call mouse move only when it really has changed
|
||||||
var LastMousePos: TPoint;
|
var LastMousePos: TPoint;
|
||||||
|
|
||||||
|
@ -165,6 +165,13 @@ begin
|
|||||||
nil, SizeOf(ActionUPP), nil, @OldActionUPP), SName, SGetEvent,
|
nil, SizeOf(ActionUPP), nil, @OldActionUPP), SName, SGetEvent,
|
||||||
SControlAction) then Exit;
|
SControlAction) then Exit;
|
||||||
|
|
||||||
|
if PostponedDown then
|
||||||
|
begin
|
||||||
|
PostponedDown := False;
|
||||||
|
NotifyApplicationUserInput(PostponedDownMsg.Msg);
|
||||||
|
DeliverMessage(AWidget.LCLObject, PostponedDownMsg);
|
||||||
|
end;
|
||||||
|
|
||||||
MouseButton := GetCarbonMouseButton(AEvent);
|
MouseButton := GetCarbonMouseButton(AEvent);
|
||||||
|
|
||||||
ActionUPP := NewControlActionUPP(@CarbonCommon_TrackProgress);
|
ActionUPP := NewControlActionUPP(@CarbonCommon_TrackProgress);
|
||||||
|
@ -62,6 +62,7 @@ var
|
|||||||
// or the rootcontrol if none found
|
// or the rootcontrol if none found
|
||||||
Widget: TCarbonWidget; // the widget specific to the mouse event
|
Widget: TCarbonWidget; // the widget specific to the mouse event
|
||||||
// or the window's widgetinfo if none found
|
// or the window's widgetinfo if none found
|
||||||
|
Postpone: Boolean;
|
||||||
const
|
const
|
||||||
SName = 'CarbonWindow_MouseProc';
|
SName = 'CarbonWindow_MouseProc';
|
||||||
|
|
||||||
@ -153,6 +154,8 @@ const
|
|||||||
Msg^.Keys := GetCarbonMsgKeyState;
|
Msg^.Keys := GetCarbonMsgKeyState;
|
||||||
|
|
||||||
CarbonWidgetSet.SetCaptureWidget(HWND(Widget));
|
CarbonWidgetSet.SetCaptureWidget(HWND(Widget));
|
||||||
|
|
||||||
|
if ClickCount > 1 then Postpone := True;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure HandleMouseUpEvent(var AMsg);
|
procedure HandleMouseUpEvent(var AMsg);
|
||||||
@ -244,6 +247,7 @@ var
|
|||||||
ViewPart: HIViewPartCode;
|
ViewPart: HIViewPartCode;
|
||||||
begin
|
begin
|
||||||
Result := EventNotHandledErr;
|
Result := EventNotHandledErr;
|
||||||
|
Postpone := False;
|
||||||
|
|
||||||
// check window part code
|
// check window part code
|
||||||
Part := inContent;
|
Part := inContent;
|
||||||
@ -284,15 +288,24 @@ begin
|
|||||||
Exit(EventNotHandledErr);
|
Exit(EventNotHandledErr);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
// Msg is set in the Appropriate HandleMousexxx procedure
|
if Postpone then
|
||||||
NotifyApplicationUserInput(Msg.Message.Msg);
|
|
||||||
if DeliverMessage(Widget.LCLObject, Msg) = 0 then
|
|
||||||
begin
|
begin
|
||||||
Result := EventNotHandledErr;
|
PostponedDown := True;
|
||||||
|
PostponedDownMsg := TLMMouse(Msg.Message);
|
||||||
|
Result := CallNextEventHandler(ANextHandler, AEvent);
|
||||||
end
|
end
|
||||||
else // the LCL does not want the event propagated
|
else
|
||||||
Result := noErr;
|
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
|
// interactive design
|
||||||
if (Widget is TCarbonDesignWindow) and (GetCarbonMouseButton(AEvent) = 1) and
|
if (Widget is TCarbonDesignWindow) and (GetCarbonMouseButton(AEvent) = 1) and
|
||||||
(EventKind = kEventMouseDown) then
|
(EventKind = kEventMouseDown) then
|
||||||
|
Loading…
Reference in New Issue
Block a user