Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

macOS: a window reopened in full screen enters it after the first frame, so the menu bar and window buttons can be revealed again (#41)

islandmed60ea075f4573
diff --git a/src/app/App.cpp b/src/app/App.cpp
index eafbf52b..dab6a0b8 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -127,7 +127,14 @@ bool App::init(const AppOptions& options) {
}
if (rememberWindow_) { // #35: where and how big it was last time
if (saved.placed) SDL_SetWindowPosition(window_, saved.x, saved.y);
+#if defined(__APPLE__)
+ // #41: full screen on macOS is its own Space, entered from a window already on screen and key; entered
+ // here, before the first frame, the menu bar and traffic lights couldn't be revealed. The loop enters it
+ // after the first swap instead.
+ if (saved.fullscreen) fullscreenAfterFirstFrame_ = true;
+#else
if (saved.fullscreen) SDL_SetWindowFullscreen(window_, true);
+#endif
else if (saved.maximized) SDL_MaximizeWindow(window_);
}
{
@@ -974,6 +981,11 @@ int App::run() {
hardwareProfileFrameEnd();
if (proof_) proofBeforeSwap(fbW, fbH); // Help > Benchmark: timing, video capture, the scripted pointer
SDL_GL_SwapWindow(window_);
+ if (fullscreenAfterFirstFrame_) { // (#41, macOS: the window is shown now; raise it, then full screen)
+ fullscreenAfterFirstFrame_ = false;
+ SDL_RaiseWindow(window_);
+ SDL_SetWindowFullscreen(window_, true);
+ }
mark();
if (phases == 7 && phase[6] - phase[0] > frameLogMs)
SDL_Log("frame %.1f ms: events %.1f, dabs %.1f, UI %.1f, ghost + sync %.1f, draw %.1f, UI draw + swap %.1f",
diff --git a/src/app/App.h b/src/app/App.h
index cee1b3a5..2caf9e74 100644
--- a/src/app/App.h
+++ b/src/app/App.h
@@ -1145,6 +1145,7 @@ private:
static WindowState loadWindowState();
void saveWindowState() const;
bool rememberWindow_ = false;
+ bool fullscreenAfterFirstFrame_ = false; // macOS: the saved full screen, entered once the window is on screen (#41)
void drawAxisGizmo();
// Insert on the model (#34): the primitive chosen in Append > Insert; a drag on the surface places it.
std::string insertType_;