From 161f3711f6a67c60fae525f3cd98e30d623d2b82 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 1 May 2020 19:19:21 -0700 Subject: [PATCH] Crabby allen got the fullscreen crash under control at least --- platform_mac/mac_4ed.mm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform_mac/mac_4ed.mm b/platform_mac/mac_4ed.mm index 5ba13299..7422dc67 100644 --- a/platform_mac/mac_4ed.mm +++ b/platform_mac/mac_4ed.mm @@ -714,6 +714,14 @@ mac_toggle_fullscreen(void){ MacProfileScope("Draw Rect"){ mac_vars.step_requested = false; + // NOTE(yuval): Toggle full screen + MacProfileScope("Toggle Full Screen"){ + if (mac_vars.do_toggle){ + mac_toggle_fullscreen(); + mac_vars.do_toggle = false; + } + } + MacProfileScope("Acquire Frame Mutex"){ // NOTE(yuval): Read comment in win32_4ed.cpp's main loop system_mutex_acquire(mac_vars.global_frame_mutex); @@ -1440,7 +1448,7 @@ main(int arg_count, char **args){ mac_vars.running_cli = 0; if (plat_settings.fullscreen_window){ - mac_toggle_fullscreen(); + mac_vars.do_toggle = true; } mac_vars.global_frame_mutex = system_mutex_make();