diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2013-12-24 02:51:47 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-01-12 22:27:10 +0000 |
commit | 7d270b1c21c692478245b90bfac0aa54c6a8d98a (patch) | |
tree | 0d62bf636c70eb8fe43d1097917ba265d258c5fb | |
parent | d3345a04849374af2b21d6624dd206c4444a6ffe (diff) | |
download | qemu-7d270b1c21c692478245b90bfac0aa54c6a8d98a.zip qemu-7d270b1c21c692478245b90bfac0aa54c6a8d98a.tar.gz qemu-7d270b1c21c692478245b90bfac0aa54c6a8d98a.tar.bz2 |
ui/cocoa: Draw black rectangle if we have no data yet
If our redraw method is called before we have any data from the guest,
then draw a black rectangle rather than leaving the window empty.
This mostly only matters when the guest machine has no framebuffer
device, but it is more in line with the behaviour of other QEMU UIs.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 1387853507-26298-3-git-send-email-peter.maydell@linaro.org
-rw-r--r-- | ui/cocoa.m | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -321,7 +321,12 @@ QemuCocoaView *cocoaView; CGContextSetShouldAntialias (viewContextRef, NO); // draw screen bitmap directly to Core Graphics context - if (dataProviderRef) { + if (!dataProviderRef) { + // Draw request before any guest device has set up a framebuffer: + // just draw an opaque black rectangle + CGContextSetRGBFillColor(viewContextRef, 0, 0, 0, 1.0); + CGContextFillRect(viewContextRef, NSRectToCGRect(rect)); + } else { CGImageRef imageRef = CGImageCreate( screen.width, //width screen.height, //height |