mirror of
https://github.com/libretro/RetroArch
synced 2025-04-11 00:44:20 +00:00
macos: improvements to remembering windowed size/position (#16436)
This commit is contained in:
parent
a9d28cd2c9
commit
80e9b9ecf4
@ -547,10 +547,11 @@ static ui_application_t ui_application_cocoa = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
NSRect frame = self.window.frame;
|
NSRect frame = self.window.frame;
|
||||||
|
NSRect bounds = self.window.contentView.bounds;
|
||||||
settings->uints.window_position_x = (unsigned)frame.origin.x;
|
settings->uints.window_position_x = (unsigned)frame.origin.x;
|
||||||
settings->uints.window_position_y = (unsigned)frame.origin.y;
|
settings->uints.window_position_y = (unsigned)frame.origin.y;
|
||||||
settings->uints.window_position_width = (unsigned)frame.size.width;
|
settings->uints.window_position_width = (unsigned)bounds.size.width;
|
||||||
settings->uints.window_position_height = (unsigned)frame.size.height;
|
settings->uints.window_position_height = (unsigned)bounds.size.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)windowDidResize:(NSNotification *)notification
|
- (void)windowDidResize:(NSNotification *)notification
|
||||||
@ -564,10 +565,11 @@ static ui_application_t ui_application_cocoa = {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
NSRect frame = self.window.frame;
|
NSRect frame = self.window.frame;
|
||||||
|
NSRect bounds = self.window.contentView.bounds;
|
||||||
settings->uints.window_position_x = (unsigned)frame.origin.x;
|
settings->uints.window_position_x = (unsigned)frame.origin.x;
|
||||||
settings->uints.window_position_y = (unsigned)frame.origin.y;
|
settings->uints.window_position_y = (unsigned)frame.origin.y;
|
||||||
settings->uints.window_position_width = (unsigned)frame.size.width;
|
settings->uints.window_position_width = (unsigned)bounds.size.width;
|
||||||
settings->uints.window_position_height = (unsigned)frame.size.height;
|
settings->uints.window_position_height = (unsigned)bounds.size.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -721,10 +723,12 @@ static ui_application_t ui_application_cocoa = {
|
|||||||
- (void)updateWindowedSize:(gfx_ctx_mode_t)mode
|
- (void)updateWindowedSize:(gfx_ctx_mode_t)mode
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
bool windowed_full = settings->bools.video_windowed_fullscreen;
|
BOOL is_fullscreen = (self.window.styleMask
|
||||||
|
& NSWindowStyleMaskFullScreen) == NSWindowStyleMaskFullScreen;
|
||||||
|
bool windowed_full = settings->bools.video_fullscreen && settings->bools.video_windowed_fullscreen;
|
||||||
bool window_save_positions = settings->bools.video_window_save_positions;
|
bool window_save_positions = settings->bools.video_window_save_positions;
|
||||||
|
|
||||||
if (windowed_full)
|
if (is_fullscreen || windowed_full)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (window_save_positions)
|
if (window_save_positions)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user