Hi Mike, Thanks for the clues. This almost does what I want - I can now jump back to the original app the user was working in. Two problems remain:
1) There is an unpleasant visual jump for the user as the quick-entry app jumps to the front and then then original app jumps back to the front. 2) If the quick-entry app is on another Space, then SL still sends the user to the other space. I guess I have to somehow disable Space switching and re-enable it after bringing the working app back to the front. That might help me with 2), but I'm not sure how to deal with 1). Time for some reading. Thanks again, Martin On Aug 21, 2010, at 11:53 PM, Michael Ash wrote: > On Sat, Aug 21, 2010 at 12:16 PM, Martin Hewitson > <martin.hewit...@aei.mpg.de> wrote: >> Dear list, >> >> I'm building an app which supports a quick-entry dialog triggered by a >> global hot-key so that the user can make entries while working in another >> app. I have this all working fine except for one thing. When the quick-entry >> dialog is dismissed, the main app window is made active, and even the Spaces >> space is switched. What I'd like is to return focus to the app that was >> running before the user pressed the global hot-key. The quick-entry window >> is shown as modal from the app delegate class. >> >> Has anyone got any hints how I might achieve the desired effect? > > Before you activate your own application, find out which application > is currently active using e.g. GetFrontProcess(). Stash the result in > a variable somewhere. When finished, reactivate the previous > application by calling e.g. SetFrontProcessWithOptions(). Be sure to > gracefully handle the case where that application is no longer > running, although that should be rare enough to not need to be *too* > graceful. > > Mike > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > http://lists.apple.com/mailman/options/cocoa-dev/martin.hewitson%40aei.mpg.de > > This email sent to martin.hewit...@aei.mpg.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Martin Hewitson Albert-Einstein-Institut Max-Planck-Institut fuer Gravitationsphysik und Universitaet Hannover Callinstr. 38, 30167 Hannover, Germany Tel: +49-511-762-17121, Fax: +49-511-762-5861 E-Mail: martin.hewit...@aei.mpg.de WWW: http://www.aei.mpg.de/~hewitson ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com