浏览代码

[macOS] Fix borderless mode on macOS 13.6+.

bruvzg 1 年之前
父节点
当前提交
873d4079d1
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      platform/macos/display_server_macos.mm

+ 3 - 1
platform/macos/display_server_macos.mm

@@ -3176,7 +3176,9 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win
 		} break;
 		case WINDOW_FLAG_BORDERLESS: {
 			// OrderOut prevents a lose focus bug with the window.
+			bool was_visible = false;
 			if ([wd.window_object isVisible]) {
+				was_visible = true;
 				[wd.window_object orderOut:nil];
 			}
 			wd.borderless = p_enabled;
@@ -3191,7 +3193,7 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win
 				[wd.window_object setFrame:frameRect display:NO];
 			}
 			_update_window_style(wd);
-			if ([wd.window_object isVisible]) {
+			if (was_visible || [wd.window_object isVisible]) {
 				if ([wd.window_object isMiniaturized]) {
 					return;
 				} else if (wd.no_focus) {