Skip to content

Commit 64ff381

Browse files
committed
macos: account for window manager decorations in frame size (libretro#13254)
1 parent 8036fed commit 64ff381

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ui/drivers/ui_cocoa.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -573,11 +573,10 @@ - (void)windowDidMove:(NSNotification *)notification
573573
return;
574574

575575
NSRect frame = self.window.frame;
576-
NSRect bounds = self.window.contentView.bounds;
577576
settings->uints.window_position_x = (unsigned)frame.origin.x;
578577
settings->uints.window_position_y = (unsigned)frame.origin.y;
579-
settings->uints.window_position_width = (unsigned)bounds.size.width;
580-
settings->uints.window_position_height = (unsigned)bounds.size.height;
578+
settings->uints.window_position_width = (unsigned)frame.size.width;
579+
settings->uints.window_position_height = (unsigned)frame.size.height;
581580
}
582581

583582
- (void)windowDidResize:(NSNotification *)notification
@@ -591,11 +590,10 @@ - (void)windowDidResize:(NSNotification *)notification
591590
return;
592591

593592
NSRect frame = self.window.frame;
594-
NSRect bounds = self.window.contentView.bounds;
595593
settings->uints.window_position_x = (unsigned)frame.origin.x;
596594
settings->uints.window_position_y = (unsigned)frame.origin.y;
597-
settings->uints.window_position_width = (unsigned)bounds.size.width;
598-
settings->uints.window_position_height = (unsigned)bounds.size.height;
595+
settings->uints.window_position_width = (unsigned)frame.size.width;
596+
settings->uints.window_position_height = (unsigned)frame.size.height;
599597
}
600598

601599
@end

0 commit comments

Comments
 (0)