From: Oscar B. <ob...@bi...> - 2007-03-29 18:55:40
|
Hi Robert, You need to apply this patch to Tk. Note however that this violates Apple's Human-Interface guidelines... #### ChangeSet #### 2006-07-21 10:45:55-07:00, ob...@di... Make Tk apps come up in the front instead of in the back when exec'ing Wish directly instead of using Launch Services to run the application. ==== macosx/tkMacOSXInit.c ==== 2006-07-21 10:45:54-07:00, ob...@di... +13 -0 Make Tk apps appear in the foreground even if not launched through LaunchServices. This breaks Aqua guidelines, but oh well. --- 1.21/macosx/tkMacOSXInit.c 2006-07-19 23:24:16 -07:00 +++ 1.22/macosx/tkMacOSXInit.c 2006-07-21 10:45:54 -07:00 @@ -255,6 +255,19 @@ TkpInit(interp) } } } +#ifdef MAC_OSX_WISH_COMES_UP_IN_FRONT + ProcessSerialNumber psn; + + /* Make sure the window comes up in the front of the calling + * application. The problem this solves is that if you exec + * the wish shell that is inside the application bundle, the + * new window appears _behind_ the calling application. + * We solve this by making Tk move its processID to the + * front of the Z-axis stacking order that the Window Server + * keeps. + */ + if (GetCurrentProcess(&psn) >= 0) SetFrontProcess(&psn); +#endif #if MAC_OSX_TK_USE_CPS_SPI /* * If we are loaded into an executable that is not a bundled application, On Mar 21, 2007, at 3:26 PM, Jeff Hobbs wrote: > Robert Karen wrote: >> Is it possible to run 'exec [info nameofexecutable] &' and have >> the new >> wish appear raised and have focus? raise commands didn't do it for >> me. > > OS X has some standard behaviors that prevent loss of focus in the > currently executing application. Tk conversely doesn't seem to be > very > aggressive in saying "I've just started up". You can use the > tclCarbonProcesses extension to force it to be the front process > (setFrontProcess). > > -- > Jeff Hobbs, The Tcl Guy, http://www.ActiveState.com/ > > ---------------------------------------------------------------------- > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to > share your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php? > page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Tcl-mac mailing list > tc...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-mac -- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1 |