All of lore.kernel.org
 help / color / mirror / Atom feed
From: Programmingkid <programmingkidx@gmail.com>
To: QEMU Developers <qemu-devel@nongnu.org>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [Bug 1802684] Re: QEMU gui crashes on macOS Mojave
Date: Sun, 11 Nov 2018 09:59:38 -0500	[thread overview]
Message-ID: <EF302223-2690-4FC2-9B05-23802B0320A3@gmail.com> (raw)
In-Reply-To: <mailman.21086.1541937348.1283.qemu-devel@nongnu.org>


> On Nov 11, 2018, at 6:55 AM, qemu-devel-request@nongnu.org wrote:
> 
> The code for the cocoa stuff is in ui/cocoa.m. Quick notes on structure:
> 
> * there is a weird thing where cocoa.m provides its own main(), and arranges that the function which is main() for every other UI is renamed qemu_main() and called later (I'd like to get rid of that one day if we could, it's just weird)
> * cocoa_display_init() is the "initialize the display" entry point -- this will always be called from on the main thread (strictly, from whichever thread OSX calls our applicationDidFinishLaunching callback on, but I assume that's the main thread)
> * the runtime entry points into the cocoa UI code are just the functions in the DisplayChangeListener struct: cocoa_update(), cocoa_switch() and cocoa_refresh()
> 
> Arranging for the last 3 to schedule their operation onto the main
> thread is probably what's needed. Things I don't know:
> 
> * should this "run thing on main thread" be synchronous or asynchronous? (sync is probably safest)
synchronous sounds good. 

> * what's the right OSX API to do this?
https://developer.apple.com/documentation/objectivec/nsobject/1414900-performselectoronmainthread?language=objc

> * how can we most cleanly do this in a way that still works on OSX 10.6 (the oldest we currently support)? (I suspect we'll need ifdefs and fall back to "just run on this thread" on older versions)

I would make another function called switchSurfaceInternal: and then move all the code from switchSurface: to this new function. Then have the switchSurface: method call the switchSurfaceInternal: method by using [performSelectorOnMainThread:withObject:waitUntilDone:]. 

The call would look like this: 
[self performSelectorOnMainThread: @selector(switchSurface:) withObject: surface waitUntilDone: YES]

I'm not sure if waitUntilDone should be set to YES. QEMU might work faster if it is set to NO. 

Thank you.

       reply	other threads:[~2018-11-11 14:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.21086.1541937348.1283.qemu-devel@nongnu.org>
2018-11-11 14:59 ` Programmingkid [this message]
     [not found] <mailman.21071.1541921951.1283.qemu-devel@nongnu.org>
2018-11-11 14:16 ` [Qemu-devel] [Bug 1802684] Re: QEMU gui crashes on macOS Mojave Programmingkid
2018-11-10 22:23 [Qemu-devel] [Bug 1802684] [NEW] " inactive
2018-11-10 22:56 ` [Qemu-devel] [Bug 1802684] " Peter Maydell
2018-11-11  0:01 ` inactive
2018-11-11 11:46 ` Peter Maydell
2018-11-11 12:00 ` inactive
2018-11-11 13:09 ` Peter Maydell
2018-11-11 19:55 ` inactive
2018-11-11 21:26 ` inactive
2018-11-11 21:28 ` inactive
2018-11-12 17:08 ` inactive
2018-11-26 15:05 ` Peter Maydell
2018-11-26 15:34   ` inactive
2018-11-29 14:37 ` Peter Maydell
2018-11-29 18:18   ` inactive
2018-11-29 14:38 ` Roman Bolshakov
2018-11-30 11:32 ` Roman Bolshakov
2018-12-03 11:45 ` Peter Maydell
2019-04-24  6:06 ` Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=EF302223-2690-4FC2-9B05-23802B0320A3@gmail.com \
    --to=programmingkidx@gmail.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.