cocoa: replacing use of GetNSObjectView with lclContentView

git-svn-id: trunk@61764 -
This commit is contained in:
dmitry 2019-08-27 19:15:44 +00:00
parent 5e4157f40b
commit 648d487f39

View File

@ -472,7 +472,7 @@ begin
Result := nil; Result := nil;
if CocoaWidgetSet.CaptureControl = 0 then Exit; if CocoaWidgetSet.CaptureControl = 0 then Exit;
obj := NSObject(CocoaWidgetSet.CaptureControl); obj := NSObject(CocoaWidgetSet.CaptureControl);
lCaptureView := GetNSObjectView(obj); lCaptureView := obj.lclContentView;
if (obj <> Owner) and (lCaptureView <> Owner) and not FIsEventRouting then if (obj <> Owner) and (lCaptureView <> Owner) and not FIsEventRouting then
begin begin
Result := lCaptureView.lclGetCallback; Result := lCaptureView.lclGetCallback;
@ -1088,7 +1088,7 @@ begin
if not targetControl.HandleAllocated then Exit; // Fixes crash due to events being sent after ReleaseHandle if not targetControl.HandleAllocated then Exit; // Fixes crash due to events being sent after ReleaseHandle
FIsEventRouting:=true; FIsEventRouting:=true;
//debugln(Target.name+' -> '+targetControl.Name+'- is parent:'+dbgs(targetControl=Target.Parent)+' Point: '+dbgs(br)+' Rect'+dbgs(rect)); //debugln(Target.name+' -> '+targetControl.Name+'- is parent:'+dbgs(targetControl=Target.Parent)+' Point: '+dbgs(br)+' Rect'+dbgs(rect));
obj := GetNSObjectView(NSObject(targetControl.Handle)); obj := NSObject(targetControl.Handle).lclContentView;
if obj = nil then Exit; if obj = nil then Exit;
callback := obj.lclGetCallback; callback := obj.lclGetCallback;
if callback = nil then Exit; // Avoids crashes if callback = nil then Exit; // Avoids crashes