Skip to content

ui/cocoa: Use OSX's main loop

Peter Maydell qemu-devel 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 4 repliesIn review
  2. v27 patches 21 repliesSuperseded
  3. v1 RFC5 patches 2 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7ui/cocoa: Ensure we have the iothread lock when calling into QEMUui/cocoa.m+65 -262 replies
2/7ui/cocoa: Use the pixman image directly in switchSurfaceui/cocoa.m+9 -80 replies
3/7ui/cocoa: Factor out initial menu creationui/cocoa.m+41 -370 replies
4/7ui/cocoa: Move console/device menu creation code up in fileui/cocoa.m+92 -920 replies
5/7ui/cocoa: Don't call NSApp sendEvent directly from handleEventui/cocoa.m+34 -150 replies
6/7ui/cocoa: Subclass NSApplication so we can implement sendEventui/cocoa.m+12 -10 replies
7/7ui/cocoa: Perform UI operations only on the main threadui/cocoa.m+116 -791 reply

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchBALATON ZoltanRoman Bolshakov
1/7R-b T-b
2/7R-b R-b T-b
3/7R-b R-b T-b
4/7R-b R-b T-b
5/7R-b R-b T-b
6/7R-b R-b T-b
7/7R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [Qemu-devel] [PATCH v3 0/7] ui/cocoa: Use OSX's main loop

This set of patches rearranges how we handle events on the OSX Cocoa UI so that we use the main thread to run the OSX event loop, and we don't do a long blocking operation from the applicationDidFinishLaunching callback. Instead we create a second thread which runs qemu_main() and becomes the QEMU main-loop thread. The callbacks from QEMU into the cocoa code asynchronously dispatch their work to the main thread, and the main thread takes the iothread lock before calling into QEMU code.

The changes from v2 to v3 are all minor, and all patches have now had review/test; I plan to apply this to master towards the end of the week, absent any further review comments.

* patch 1: add with_iothread_lock wrap to qmp_stop/qmp_cont calls
* patch 5: remove stray whitespace
* patch 7: remove unnecessary null check on cocoaView
* patch 7: make semaphore variables file-local
* patch 7: deref pixman_image in dealloc

thanks
-- PMM

Peter Maydell (7):
ui/cocoa: Ensure we have the iothread lock when calling into QEMU ui/cocoa: Use the pixman image directly in switchSurface ui/cocoa: Factor out initial menu creation
ui/cocoa: Move console/device menu creation code up in file ui/cocoa: Don't call NSApp sendEvent directly from handleEvent ui/cocoa: Subclass NSApplication so we can implement sendEvent ui/cocoa: Perform UI operations only on the main thread

 ui/cocoa.m | 495 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 303 insertions(+), 192 deletions(-)
Signature · 1 line
2.17.2 (Apple Git-113)