소스 검색

Merge pull request #82357 from bruvzg/mac_fix_bl

[macOS] Fix borderless mode on macOS 13.6+.
Rémi Verschelde 1 년 전
부모
커밋
124f8983b8
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      platform/macos/display_server_macos.mm

+ 3 - 1
platform/macos/display_server_macos.mm

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