mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 13:39:11 +02:00
Carbon: fixes an endless loop in mouseover which was affecting the project openpoker
git-svn-id: trunk@31352 -
This commit is contained in:
parent
0e1e1911b7
commit
6acf2ce81d
@ -264,6 +264,7 @@ var
|
|||||||
P, ClientPt, ControlPt: TPoint;
|
P, ClientPt, ControlPt: TPoint;
|
||||||
DesignPt: HIPoint;
|
DesignPt: HIPoint;
|
||||||
ViewPart: HIViewPartCode;
|
ViewPart: HIViewPartCode;
|
||||||
|
lTmpWidget: TCarbonWidget;
|
||||||
begin
|
begin
|
||||||
Result := EventNotHandledErr;
|
Result := EventNotHandledErr;
|
||||||
Postpone := False;
|
Postpone := False;
|
||||||
@ -286,7 +287,13 @@ begin
|
|||||||
|
|
||||||
Widget := GetCarbonWidget(Control);
|
Widget := GetCarbonWidget(Control);
|
||||||
while Assigned(Widget) and not Widget.IsEnabled do
|
while Assigned(Widget) and not Widget.IsEnabled do
|
||||||
Widget := TCarbonWidget(CarbonWidgetset.GetParent(HWND(Widget)));
|
begin
|
||||||
|
// Here we need to avoid an endless loop which might occur in case
|
||||||
|
// GetParent returns the same widget that we passed
|
||||||
|
lTmpWidget := TCarbonWidget(CarbonWidgetset.GetParent(HWND(Widget)));
|
||||||
|
if lTmpWidget = Widget then Break;
|
||||||
|
Widget := lTmpWidget;
|
||||||
|
end;
|
||||||
if Widget = nil then Exit;
|
if Widget = nil then Exit;
|
||||||
|
|
||||||
FillChar(Msg, SizeOf(Msg), 0);
|
FillChar(Msg, SizeOf(Msg), 0);
|
||||||
|
@ -1770,6 +1770,9 @@ begin
|
|||||||
|
|
||||||
if TCarbonWidget(Handle) is TCarbonControl then
|
if TCarbonWidget(Handle) is TCarbonControl then
|
||||||
begin
|
begin
|
||||||
|
{$IFDEF VerboseWinAPI}
|
||||||
|
DebugLn('TCarbonWidgetSet.GetParent Widget: ' + DbgS(TCarbonControl(Handle).Widget));
|
||||||
|
{$ENDIF}
|
||||||
Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
|
Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
|
||||||
if Result = 0 then // no parent control => then parent is a window?
|
if Result = 0 then // no parent control => then parent is a window?
|
||||||
Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
|
Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
|
||||||
|
Loading…
Reference in New Issue
Block a user