From 874b469cf084470cecd8bcc0b678a8cc9b4f6453 Mon Sep 17 00:00:00 2001 From: rogerman Date: Thu, 16 Aug 2012 00:51:06 +0000 Subject: [PATCH] Cocoa Port: - Fix one more bug related to main window positioning, which occurs when the status bar is shown when the main window is too large for the desktop content area. --- desmume/src/cocoa/userinterface/emuWindowDelegate.mm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm index a6b3b3c3a..e1900404c 100644 --- a/desmume/src/cocoa/userinterface/emuWindowDelegate.mm +++ b/desmume/src/cocoa/userinterface/emuWindowDelegate.mm @@ -1002,7 +1002,6 @@ if (showStatusBar) { statusBarHeight = WINDOW_STATUS_BAR_HEIGHT; - frameRect.origin.y -= WINDOW_STATUS_BAR_HEIGHT; frameRect.size.height += WINDOW_STATUS_BAR_HEIGHT; NSRect screenFrame = [[NSScreen mainScreen] visibleFrame]; @@ -1012,8 +1011,14 @@ double widthToHeightRatio = windowContentRect.size.width / windowContentRect.size.height; windowContentRect.size.height -= frameRect.size.height - screenFrame.size.height; windowContentRect.size.width = windowContentRect.size.height * widthToHeightRatio; + + frameRect.size.height = screenFrame.size.height; frameRect.size.width = windowContentRect.size.width; } + else + { + frameRect.origin.y -= WINDOW_STATUS_BAR_HEIGHT; + } } else {