mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 20:19:16 +02:00
cocoa: Implements support for wsFullscreen
git-svn-id: trunk@55839 -
This commit is contained in:
parent
75a7416c5d
commit
7f491d80fb
@ -926,6 +926,8 @@ end;
|
|||||||
function TCocoaWidgetSet.ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
|
function TCocoaWidgetSet.ShowWindow(hWnd: HWND; nCmdShow: Integer): Boolean;
|
||||||
var
|
var
|
||||||
win: NSWindow;
|
win: NSWindow;
|
||||||
|
lCocoaWin: TCocoaWindow = nil;
|
||||||
|
lWinContent: TCocoaWindowContent = nil;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseCocoaWinAPI}
|
{$ifdef VerboseCocoaWinAPI}
|
||||||
DebugLn('TCocoaWidgetSet.ShowWindow');
|
DebugLn('TCocoaWidgetSet.ShowWindow');
|
||||||
@ -934,7 +936,11 @@ begin
|
|||||||
//todo: should a call to lclShowWindow (to be added) be made instead?
|
//todo: should a call to lclShowWindow (to be added) be made instead?
|
||||||
if (NSObject(hWnd).isKindOfClass(TCocoaWindowContent)) and (not TCocoaWindowContent(hWnd).isembedded) then
|
if (NSObject(hWnd).isKindOfClass(TCocoaWindowContent)) and (not TCocoaWindowContent(hWnd).isembedded) then
|
||||||
begin
|
begin
|
||||||
win := TCocoaWindowContent(hWnd).window;
|
lWinContent := TCocoaWindowContent(hWnd);
|
||||||
|
win := lWinContent.window;
|
||||||
|
if win.isKindOfClass(TCocoaWindow) then
|
||||||
|
lCocoaWin := TCocoaWindow(win);
|
||||||
|
|
||||||
case nCmdShow of
|
case nCmdShow of
|
||||||
SW_SHOW, SW_SHOWNORMAL:
|
SW_SHOW, SW_SHOWNORMAL:
|
||||||
win.orderFront(nil);
|
win.orderFront(nil);
|
||||||
@ -945,9 +951,25 @@ begin
|
|||||||
SW_MAXIMIZE:
|
SW_MAXIMIZE:
|
||||||
win.zoom(nil);
|
win.zoom(nil);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
// Fullscreen status change
|
||||||
|
if (nCmdShow <> SW_MINIMIZE) and (nCmdShow <> SW_HIDE) then
|
||||||
|
begin
|
||||||
|
// getting out of fullscreen
|
||||||
|
if (nCmdShow <> SW_SHOWFULLSCREEN) and lWinContent.isInFullScreenMode() then
|
||||||
|
begin
|
||||||
|
// lWinContent.exitFullScreenModeWithOptions(nil); <-- THIS CAUSES A CRASH!!!
|
||||||
|
end
|
||||||
|
// getting into fullscreen mode
|
||||||
|
else if (nCmdShow = SW_SHOWFULLSCREEN) and not lWinContent.isInFullScreenMode() then
|
||||||
|
begin
|
||||||
|
lWinContent.enterFullScreenMode_withOptions(NSScreen.mainScreen, nil);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
NSObject(hWnd).lclSetVisible(nCmdSHow <> SW_HIDE);
|
NSObject(hWnd).lclSetVisible(nCmdSHow <> SW_HIDE);
|
||||||
|
|
||||||
Result:=true;
|
Result:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user