mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 20:41:37 +02:00
Cocoa/Form: make OnTopForm compatible with FullScreen
This commit is contained in:
parent
481187923e
commit
dd43ea568f
@ -146,6 +146,7 @@ type
|
||||
public
|
||||
_keyEvCallback: ICommonCallback;
|
||||
callback: IWindowCallback;
|
||||
keepWinLevel : NSInteger;
|
||||
//LCLForm: TCustomForm;
|
||||
procedure dealloc; override;
|
||||
function makeFirstResponder(aResponder: NSResponder): ObjCBOOL; override;
|
||||
@ -775,6 +776,8 @@ begin
|
||||
// MacOS does 10.7 fullscreen switch with an animation (that's about 1 second long)
|
||||
// if during that animation there's another call toggleFullScreen() is made
|
||||
// then macOS produces an output "not in fullscreen state" and ignores the call.
|
||||
|
||||
self.setLevel( NSNormalWindowLevel );
|
||||
end;
|
||||
|
||||
procedure TCocoaWindow.windowDidEnterFullScreen(notification: NSNotification);
|
||||
@ -788,6 +791,9 @@ begin
|
||||
if orderOutAfterFS then begin
|
||||
self.orderOut(nil);
|
||||
orderOutAfterFS := false;
|
||||
end else begin
|
||||
if self.level<>self.keepWinLevel then
|
||||
self.setLevel(self.keepWinLevel);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
@ -231,6 +231,8 @@ var
|
||||
begin
|
||||
lvl := CGWindowLevelForKey(FormStyleToWindowLevelKey[AFormStyle]);
|
||||
win.setLevel(lvl);
|
||||
if win.isKindOfClass(TCocoaWindow) then
|
||||
TCocoaWindow(win).keepWinLevel := lvl;
|
||||
end;
|
||||
|
||||
{ TCocoaWSHintWindow }
|
||||
|
Loading…
Reference in New Issue
Block a user