From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46328) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2Ttn-000661-Bb for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W2Ttm-00057E-9C for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:55 -0500 Received: from mnementh.archaic.org.uk ([2001:8b0:1d0::1]:44745) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W2Ttm-00055e-2o for qemu-devel@nongnu.org; Sun, 12 Jan 2014 17:52:54 -0500 From: Peter Maydell Date: Sun, 12 Jan 2014 22:52:36 +0000 Message-Id: <1389567158-31066-8-git-send-email-peter.maydell@linaro.org> In-Reply-To: <1389567158-31066-1-git-send-email-peter.maydell@linaro.org> References: <1389567158-31066-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PULL 7/9] ui/cocoa: Draw black rectangle if we have no data yet List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Blue Swirl , =?UTF-8?q?Andreas=20F=C3=A4rber?= , qemu-devel@nongnu.org, Aurelien Jarno 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 Message-id: 1387853507-26298-3-git-send-email-peter.maydell@linaro.org --- ui/cocoa.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ui/cocoa.m b/ui/cocoa.m index 6a1f6b6..22ec29b 100644 --- a/ui/cocoa.m +++ b/ui/cocoa.m @@ -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 -- 1.8.5