Cocoa/Form: adapt WindowLevel to be adjusted by System

This commit is contained in:
rich2014 2023-11-16 14:10:42 +08:00
parent e6e4867d52
commit e60b72117e
2 changed files with 0 additions and 15 deletions

View File

@ -146,7 +146,6 @@ type
public
_keyEvCallback: ICommonCallback;
callback: IWindowCallback;
keepWinLevel : NSInteger;
//LCLForm: TCustomForm;
procedure dealloc; override;
function makeFirstResponder(aResponder: NSResponder): ObjCBOOL; override;
@ -732,18 +731,6 @@ end;
procedure TCocoaWindow.windowDidBecomeKey(notification: NSNotification);
begin
// forcing to keep the level as all other LCL windows
// Modal windows tend to "restore" their elevated level
// And that doesn't work for modal windows that are "Showing" other windows
// Another approach is to set elevated levels for windows, shown during modal session
// That requires to revoke the elevated level from windows on closing a window session
// This might be the way to go, if FormStyle (such as fsStayOnTop) would come
// in conflict with modality
if level <> keepWinLevel then begin
setLevel(keepWinLevel);
end;
if Assigned(callback) then
callback.Activate;

View File

@ -231,8 +231,6 @@ var
begin
lvl := CGWindowLevelForKey(FormStyleToWindowLevelKey[AFormStyle]);
win.setLevel(lvl);
if win.isKindOfClass(TCocoaWindow) then
TCocoaWindow(win).keepWinLevel := lvl;
end;
{ TCocoaWSHintWindow }