[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 7/9] ui/cocoa: Draw black rectangle if we have no dat
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 7/9] ui/cocoa: Draw black rectangle if we have no data yet |
Date: |
Sun, 12 Jan 2014 22:52:36 +0000 |
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 <address@hidden>
Message-id: address@hidden
---
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
- [Qemu-devel] [PULL 0/9] cocoa queue, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 5/9] ui/cocoa: Fix code for starting QEMU via image file load dialog, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 3/9] ui/cocoa: Send warning message to stderr, not stdout, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 6/9] ui/cocoa: Redraw at correct size when switching surface, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 4/9] ui/cocoa: Add ".qcow2" to extension list for image load dialog, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 2/9] ui/cocoa: Correct typos in comments and variable names, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 9/9] MAINTAINERS: add myself as cocoa UI co-maintainer, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 1/9] ui/cocoa: Pass command key through to guest when VM has mousegrab, Peter Maydell, 2014/01/12
- [Qemu-devel] [PULL 7/9] ui/cocoa: Draw black rectangle if we have no data yet,
Peter Maydell <=
- [Qemu-devel] [PULL 8/9] ui/cocoa: Remove stray tabs, Peter Maydell, 2014/01/12