mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-16 02:39:15 +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;
|
||||
DesignPt: HIPoint;
|
||||
ViewPart: HIViewPartCode;
|
||||
lTmpWidget: TCarbonWidget;
|
||||
begin
|
||||
Result := EventNotHandledErr;
|
||||
Postpone := False;
|
||||
@ -286,7 +287,13 @@ begin
|
||||
|
||||
Widget := GetCarbonWidget(Control);
|
||||
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;
|
||||
|
||||
FillChar(Msg, SizeOf(Msg), 0);
|
||||
|
@ -1770,6 +1770,9 @@ begin
|
||||
|
||||
if TCarbonWidget(Handle) is TCarbonControl then
|
||||
begin
|
||||
{$IFDEF VerboseWinAPI}
|
||||
DebugLn('TCarbonWidgetSet.GetParent Widget: ' + DbgS(TCarbonControl(Handle).Widget));
|
||||
{$ENDIF}
|
||||
Result := HWnd(GetCarbonWidget(HIViewGetSuperview(TCarbonControl(Handle).Widget)));
|
||||
if Result = 0 then // no parent control => then parent is a window?
|
||||
Result := HWnd(GetCarbonWidget(HIViewGetWindow(TCarbonControl(Handle).Widget)));
|
||||
|
Loading…
Reference in New Issue
Block a user