Cleanup previous PR

Fix leak of sub view and ensure child window has correct color space
This commit is contained in:
Kovid Goyal
2026-03-17 20:14:02 +05:30
parent 42305c3464
commit 0321ca04f0
2 changed files with 4 additions and 0 deletions

View File

@@ -180,6 +180,8 @@ Detailed list of changes
- choose files kitten: Fix a regression that caused incorrect highlight of matched letters - choose files kitten: Fix a regression that caused incorrect highlight of matched letters
- macOS: When using :opt:`macos_traditional_fullscreen` do not render content under the notch (:pull:`9678`)
0.46.1 [2026-03-16] 0.46.1 [2026-03-16]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -3386,6 +3386,7 @@ _glfwUpdateNotchCover(_GLFWwindow* w) {
[bg_window setOpaque:NO]; [bg_window setOpaque:NO];
[bg_window setIgnoresMouseEvents:YES]; [bg_window setIgnoresMouseEvents:YES];
[bg_window setReleasedWhenClosed:NO]; [bg_window setReleasedWhenClosed:NO];
[bg_window setColorSpace:[window colorSpace]];
// Add a colored subview only in the notch strip area // Add a colored subview only in the notch strip area
NSView *notchView = [[NSView alloc] initWithFrame:NSMakeRect(0, sf.size.height - insetTop, sf.size.width, insetTop)]; NSView *notchView = [[NSView alloc] initWithFrame:NSMakeRect(0, sf.size.height - insetTop, sf.size.width, insetTop)];
notchView.wantsLayer = YES; notchView.wantsLayer = YES;
@@ -3398,6 +3399,7 @@ _glfwUpdateNotchCover(_GLFWwindow* w) {
[bg_window.contentView addSubview:notchView]; [bg_window.contentView addSubview:notchView];
[window addChildWindow:bg_window ordered:NSWindowBelow]; [window addChildWindow:bg_window ordered:NSWindowBelow];
w->ns.notch_cover_window = bg_window; w->ns.notch_cover_window = bg_window;
[notchView release];
} }
} }