aboutsummaryrefslogtreecommitdiff
path: root/ui/cocoa.m
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-06-23 10:35:22 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-06-29 22:00:33 +0100
commit381600dad956ba246f8cb9806e70423f4121bae3 (patch)
tree1b823d5958c60239c5ac190117bd7d2a22feb625 /ui/cocoa.m
parent9328cfd2fe4a7ff86a41b2c26ea33974241d7d4e (diff)
ui/cocoa: Cope with first surface being same as initial window size
Do the recalculation of the content dimensions in switchSurface if the current cdx is zero as well as if the new surface is a different size to the current window. This catches the case where the first surface registered happens to be 640x480 (our current window size), and fixes a bug where we would always display a black screen until the first surface of a different size was registered. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Message-id: 1403516125-14568-2-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'ui/cocoa.m')
-rw-r--r--ui/cocoa.m6
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/cocoa.m b/ui/cocoa.m
index f20fd1ffa2..a270a464d8 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -404,7 +404,11 @@ QemuCocoaView *cocoaView;
int w = surface_width(surface);
int h = surface_height(surface);
- bool isResize = (w != screen.width || h != screen.height);
+ /* cdx == 0 means this is our very first surface, in which case we need
+ * to recalculate the content dimensions even if it happens to be the size
+ * of the initial empty window.
+ */
+ bool isResize = (w != screen.width || h != screen.height || cdx == 0.0);
int oldh = screen.height;
if (isResize) {