• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Share NSView between processes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Share NSView between processes


  • Subject: Share NSView between processes
  • From: Zak Nelson <email@hidden>
  • Date: Wed, 19 Sep 2012 19:05:56 -0700
  • Acceptlanguage: en, en-US
  • Thread-topic: Share NSView between processes

At a high level, I'd like to share an NSView between processes. On Windows, you can share HWNDs across the process boundary, but on mac this doesn't seem possible (http://stackoverflow.com/questions/583202/mac-os-x-can-one-process-render-to-another-processs-window). To get around this, I'm hiding my subprocess' view and using the IOSurface APIs (http://developer.apple.com/library/mac/#documentation/Miscellaneous/Reference/IOSurfaceAPI_header_reference/Reference/reference.html) to get the bitmap back into the parent process.

I've had some success with this approach and it seems performant enough. The problem I'm having now is in sending mouse events to the subprocess' view. Calling [NSApp sendEvent] from the subprocess, the events don't arrive, which I guess is because the application is not in the foreground. I've also tried using CGEventPost which requires the view to be visible and the API moves the mouse, two non-starters. Based on this research it appears impossible to send mouse events to views without key focus.

The next approach I've been considering, which is even more outlandish than my current setup, is to overlay the subprocess' window on top of parent's window. There are a number of edge cases I'm not keen on handling, and that's assuming it's efficient enough to not look terrible.

So at this stage I thought I'd take a step back and seek help. Do my assumptions look valid? Is there perhaps an alternative approach?

Thanks for any help.

Zak
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Share NSView between processes
      • From: Ken Thomases <email@hidden>
    • Re: Share NSView between processes
      • From: Mikevann <email@hidden>
  • Prev by Date: Re: kABHomeLabel … and companions
  • Next by Date: Toddler-proofing an app (disabling spotlight keyboard shortcut)?
  • Previous by thread: Re: How to prevent Segue with modal form-sheet and AutoLayout from resizing my view?
  • Next by thread: Re: Share NSView between processes
  • Index(es):
    • Date
    • Thread