Merge pull request #111657 from bruvzg/mac26_gl_hang

[macOS] Fix ~500ms hang on transparent OpenGL window creation on macOS 26.
This commit is contained in:
Thaddeus Crews 2025-10-15 16:31:03 -05:00
commit 57e041d357
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -2647,9 +2647,11 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win
[wd.window_object setBackgroundColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.004f]];
}
// Force update of the window styles.
NSRect frameRect = [wd.window_object frame];
[wd.window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
[wd.window_object setFrame:frameRect display:NO];
if ([wd.window_object isVisible]) {
NSRect frameRect = [wd.window_object frame];
[wd.window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
[wd.window_object setFrame:frameRect display:NO];
}
}
_update_window_style(wd, p_window);
if (was_visible || [wd.window_object isVisible]) {
@ -2683,9 +2685,11 @@ void DisplayServerMacOS::window_set_flag(WindowFlags p_flag, bool p_enabled, Win
wd.layered_window = p_enabled;
set_window_per_pixel_transparency_enabled(p_enabled, p_window);
// Force update of the window styles.
NSRect frameRect = [wd.window_object frame];
[wd.window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
[wd.window_object setFrame:frameRect display:NO];
if ([wd.window_object isVisible]) {
NSRect frameRect = [wd.window_object frame];
[wd.window_object setFrame:NSMakeRect(frameRect.origin.x, frameRect.origin.y, frameRect.size.width + 1, frameRect.size.height) display:NO];
[wd.window_object setFrame:frameRect display:NO];
}
} break;
case WINDOW_FLAG_NO_FOCUS: {
wd.no_focus = p_enabled;