mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-20 17:19:31 +02:00
Cocoa: fix the issue when call TCocoaWindow.makeFirstResponder() with nil
This commit is contained in:
parent
24dae4f817
commit
52aafa7090
@ -1021,7 +1021,11 @@ end;
|
||||
// return proper focused responder by kind of class of NSResponder
|
||||
function getProperFocusedResponder( const aResponder : NSResponder ): NSResponder;
|
||||
begin
|
||||
Result := aResponder;
|
||||
if aResponder<>nil then
|
||||
Result := aResponder
|
||||
else
|
||||
Result:= NSApp.keyWindow;
|
||||
|
||||
if Result.isKindOfClass(NSWindow) then
|
||||
Result:= TCocoaWindowContent(NSWindow(Result).contentView).documentView;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user