Merged revision(s) 62481 #11fb196904, 62490 #5301fa49cb from trunk:

cocoa: forcing focusing of the content view, if window gets focused
........
cocoa: ShowHide only activates non hint window. Hint window are brought to front, but not getting focus. bug #36516
........

git-svn-id: branches/fixes_2_0@62499 -
This commit is contained in:
dmitry 2020-01-05 07:14:49 +00:00
parent 08a6145ef0
commit 61b50a74b1
2 changed files with 8 additions and 1 deletions

View File

@ -746,6 +746,13 @@ begin
if Assigned(callback) then
callback.Activate;
// LCL didn't change focus. TCocoaWindow should not keep the focus for itself
// and it should pass it to it's content view
if (firstResponder = self)
and Assigned(contentView)
and (contentView.isKindOfClass(TCocoaWindowContent)) then
self.makeFirstResponder( TCocoaWindowContent(contentView).documentView );
end;
procedure TCocoaWindow.windowDidResignKey(notification: NSNotification);

View File

@ -1126,7 +1126,7 @@ begin
TCocoaWSWinControl.ShowHide(AWinControl);
// ShowHide() also actives (sets focus to) the window
if lShow and Assigned(w) then
if lShow and Assigned(w) and not (w.isKindOfClass(NSPanel)) then
w.makeKeyWindow;
end;