mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-10 22:16:17 +02:00
Cocoa: avoid unexpected changes in the focus control during TabControl update
This commit is contained in:
parent
ab1d8281f2
commit
ac6d122b39
@ -363,7 +363,12 @@ procedure UpdateTabAndArrowVisibility(aview: TCocoaTabControl);
|
||||
var
|
||||
showNext : Boolean;
|
||||
showPrev : Boolean;
|
||||
responder: NSResponder;
|
||||
begin
|
||||
responder:= nil;
|
||||
if Assigned(aview.window) then
|
||||
responder:= aview.window.firstResponder;
|
||||
|
||||
ReviseTabs(aview, showPrev, showNExt);
|
||||
aview.updateVariousIndex;
|
||||
if Assigned(aview.prevarr) then
|
||||
@ -384,6 +389,11 @@ begin
|
||||
aview.nextarr.setHidden(not showNext);
|
||||
{$endif}
|
||||
end;
|
||||
|
||||
if Assigned(aview.window) then begin
|
||||
if Assigned(responder) and (responder<>aview.window.firstResponder) then
|
||||
aview.window.makeFirstResponder(responder);
|
||||
end;
|
||||
end;
|
||||
|
||||
function IndexOfTab(ahost: TCocoaTabControl; atab: NSTabViewItem): Integer;
|
||||
|
Loading…
Reference in New Issue
Block a user