// 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
win.toggleFullScreen(nil);
// lWinContent.exitFullScreenModeWithOptions(nil); <-- THIS CAUSES A CRASH!!!
end
// getting into fullscreen mode
else if (nCmdShow = SW_SHOWFULLSCREEN) and not lWinContent.isInFullScreenMode() then
begin
win.toggleFullScreen(nil);
// lWinContent.enterFullScreenMode_withOptions(NSScreen.mainScreen, nil);
end;
end;