From 648d487f392818426911ebbc3210542ae7780866 Mon Sep 17 00:00:00 2001 From: dmitry Date: Tue, 27 Aug 2019 19:15:44 +0000 Subject: [PATCH] cocoa: replacing use of GetNSObjectView with lclContentView git-svn-id: trunk@61764 - --- lcl/interfaces/cocoa/cocoawscommon.pas | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/interfaces/cocoa/cocoawscommon.pas b/lcl/interfaces/cocoa/cocoawscommon.pas index fcaeaa5342..bae9aac653 100644 --- a/lcl/interfaces/cocoa/cocoawscommon.pas +++ b/lcl/interfaces/cocoa/cocoawscommon.pas @@ -472,7 +472,7 @@ begin Result := nil; if CocoaWidgetSet.CaptureControl = 0 then Exit; obj := NSObject(CocoaWidgetSet.CaptureControl); - lCaptureView := GetNSObjectView(obj); + lCaptureView := obj.lclContentView; if (obj <> Owner) and (lCaptureView <> Owner) and not FIsEventRouting then begin Result := lCaptureView.lclGetCallback; @@ -1088,7 +1088,7 @@ begin if not targetControl.HandleAllocated then Exit; // Fixes crash due to events being sent after ReleaseHandle FIsEventRouting:=true; //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; callback := obj.lclGetCallback; if callback = nil then Exit; // Avoids crashes