> On Nov 11, 2018, at 4:35 PM, qemu-devel-requ...@nongnu.org wrote: > > It seems that Cocoa checks are stricter on Mojave and some callbacks that > worked from non-GUI thread on High Sierra are no longer working. > > The fixes included here are: > > * Deferring qemu_main() to another thread so that the actual main thread is > reserved for the Cocoa UI; it also removes blocking from > applicationDidFinishLoading: delegate. I beleive this alone caused complete > UI blockage on Mojave. > * Deferring UI-related updates in callbacks to the UI thread using > invokeOnMainThread helper function. This function uses DDInvocationGrabber > object courtesy of Dave Dribin, licensed under MIT license. > Here?s relevant blog post for his code: > https://www.dribin.org/dave/blog/archives/2008/05/22/invoke_on_main_thread/ > > NSInvocation is used here instead of plain > performSelectorOnMainThread:withObject:waitUntilDone: because we want to be > able to pass non-id types to the handlers.
Couldn't we use [NSValue valueWithPointer:] to pass the struct instance to performSelectorOnMainThread:withObject:waitUntilDone:? https://developer.apple.com/documentation/foundation/nsvalue/1415975-valuewithpointer?language=objc > These changes are ought to work on OSX 10.6, although I don?t have a machine > handy to test it. I have Mac OS 10.6 available for testing. I just don't think all this code is necessary to fix this issue. Hopefully I will have the time later today to investigate this issue some more.