Skip to content

Commit 8bef718

Browse files
committed
Tighten the scope searched for sub views
1 parent b6f9080 commit 8bef718

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

glfw/cocoa_window.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3280,17 +3280,17 @@ @implementation NSView (FindByIdentifier)
32803280
static
32813281
void clear_title_bar_background_views(NSWindow *window) {
32823282
#define tag @"kitty-for-transparent-titlebar"
3283-
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
3284-
if (titlebarContainer) {
3285-
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
3283+
NSView *contentView = window.contentView;
3284+
if (contentView) {
3285+
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
32863286
}
32873287
}
32883288

32893289
static void
32903290
set_title_bar_background(NSWindow *window, NSColor *backgroundColor) {
32913291
NSView *contentView = window.contentView, *titlebarContainer = contentView ? contentView.superview : nil;
32923292
if (!titlebarContainer) return;
3293-
for (NSView *subview in [titlebarContainer viewsWithIdentifier:tag]) [subview removeFromSuperview];
3293+
for (NSView *subview in [contentView viewsWithIdentifier:tag]) [subview removeFromSuperview];
32943294
if (!backgroundColor) return;
32953295

32963296
const CGFloat height = title_bar_and_tool_bar_height(window);

0 commit comments

Comments
 (0)