cocoa: preventing HintWindow from acquiring focus on show

git-svn-id: trunk@58649 -
This commit is contained in:
dmitry 2018-07-29 20:56:44 +00:00
parent 123ec7ffae
commit 474bd626f3
2 changed files with 8 additions and 1 deletions

View File

@ -183,6 +183,7 @@ type
procedure didResignKeyNotification(sender: NSNotification); message 'didResignKeyNotification:';
public
isembedded: Boolean; // true - if the content is inside of another control, false - if the content is in its own window;
preventKeyOnShow: Boolean;
ownwin: NSWindow;
fswin: NSWindow; // window that was used as a content prior to switching to old-school fullscreen
popup_parent: HWND; // if not 0, indicates that we should set the popup parent
@ -389,7 +390,12 @@ begin
window.orderOut(nil)
else
if not aisHidden and not window.isVisible then
window.makeKeyAndOrderFront(nil);
begin
if preventKeyOnShow then // used for Hint-windows, so they would not steal the focus from the current window
window.orderFrontRegardless
else
window.makeKeyAndOrderFront(nil);
end;
end;
end;

View File

@ -239,6 +239,7 @@ begin
cb := TLCLWindowCallback.Create(cnt, AWinControl);
cb.window := win;
cnt.callback := cb;
cnt.preventKeyOnShow := true;
TCocoaPanel(win).callback := cb;
win.setContentView(cnt);