Hello,

Am 12.11.2009 um 19:15 schrieb G 3:

The Priority menu controls how much cpu time qemu receives, and the Machine menu has the Restart menu item for restarting the emulator.

Signed-off-by: John Arbuckle <programmingk...@gmail.com>
---
cocoa.m | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++ +--------
1 files changed, 79 insertions(+), 12 deletions(-)

Please do not combine unrelated changes into one large patch.

I'm not sure if adding more menus to QEMU is the way to go, considering that this has traditionally been the job of frontends like Q. I haven't noticed such options in the SDL frontend either. What I am missing though is the system-provided Services menu item in the application menu.

diff --git a/cocoa.m b/cocoa.m
index 55ff2b4..14a3004 100644
--- a/cocoa.m
+++ b/cocoa.m

@@ -947,13 +1004,23 @@ static void cocoa_refresh(DisplayState *ds)

    NSDate *distantPast;
    NSEvent *event;
+       int count;
+       
+       count = 0;
    distantPast = [NSDate distantPast];
-    do {
+    do {               
+               
+               if(qemuAtHighPriority == NO) {
+                       sleep(1000);
+               }
+               
event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:distantPast
                        inMode: NSDefaultRunLoopMode dequeue:YES];
        if (event != nil) {
            [cocoaView handleEvent:event];
-        }

What exactly are you trying to accomplish with this patch?

This is most certainly the wrong way, you are blocking the event loop during a pending update for one second. If you want to throttle events like screen updates or reduce the QEMU- induced CPU load, this likely needs to be done in another way, putting less events into the queue in the first place, no?

+               }
+
+               
    } while(event != nil);
    vga_hw_update();
}

Andreas


Reply via email to