浏览代码

Set activation policy before making window fullscreen

Daniel Hooper 4 月之前
父节点
当前提交
43f3c19eca
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      sokol_app.h

+ 1 - 1
sokol_app.h

@@ -4097,11 +4097,11 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) {
     #endif
     #endif
     [_sapp.macos.window center];
     [_sapp.macos.window center];
     _sapp.valid = true;
     _sapp.valid = true;
+    NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
     if (_sapp.fullscreen) {
     if (_sapp.fullscreen) {
         /* ^^^ on GL, this already toggles a rendered frame, so set the valid flag before */
         /* ^^^ on GL, this already toggles a rendered frame, so set the valid flag before */
         [_sapp.macos.window toggleFullScreen:self];
         [_sapp.macos.window toggleFullScreen:self];
     }
     }
-    NSApp.activationPolicy = NSApplicationActivationPolicyRegular;
     [NSApp activateIgnoringOtherApps:YES];
     [NSApp activateIgnoringOtherApps:YES];
     [_sapp.macos.window makeKeyAndOrderFront:nil];
     [_sapp.macos.window makeKeyAndOrderFront:nil];
     _sapp_macos_update_dimensions();
     _sapp_macos_update_dimensions();