diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index b0a36beb75..046a878e7e 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -420,6 +420,9 @@ static bool cocoa_gl_gfx_ctx_set_video_mode(void *data, if (!has_went_fullscreen) { [g_view enterFullScreenMode:(BRIDGE NSScreen *)cocoa_screen_get_chosen() withOptions:nil]; +#ifdef HAVE_COCOA_METAL + [apple_platform setupMainWindow]; +#endif cocoa_show_mouse(data, false); } } diff --git a/ui/drivers/cocoa/apple_platform.h b/ui/drivers/cocoa/apple_platform.h index c7f78faaf6..728209738f 100644 --- a/ui/drivers/cocoa/apple_platform.h +++ b/ui/drivers/cocoa/apple_platform.h @@ -28,6 +28,7 @@ * the displays should not sleep. */ - (bool)setDisableDisplaySleep:(bool)disable; +- (void)setupMainWindow; @end #endif diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index ea6d292816..01269fee1f 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -565,8 +565,7 @@ static ui_application_t ui_application_cocoa = { waiting_argc = 0; #ifdef HAVE_COCOA_METAL - [self.window makeMainWindow]; - [self.window makeKeyWindow]; + [self setupMainWindow]; #endif [self performSelectorOnMainThread:@selector(rarch_main) withObject:nil waitUntilDone:NO]; @@ -575,6 +574,12 @@ static ui_application_t ui_application_cocoa = { #pragma mark - ApplePlatform #ifdef HAVE_COCOA_METAL +- (void)setupMainWindow +{ + [self.window makeMainWindow]; + [self.window makeKeyWindow]; +} + - (void)setViewType:(apple_view_type_t)vt { if (vt == _vt)