The following change to osgViewer allows OSG applications built 
on OSX outside of Xcode (i.e. not as a .app bundle) to obtain 
keyboard focus. Before Robert commits the change it would for 
worthwhile for Xcode users to verify that this doesn't interact
badly with apps that have already become foreground applications 
(e.g. those started from a .app bundle, which presumably does
this at initialization time). 

the calls to add at the end of GraphicsWindowCarbon::realizeImplementation
(in src/osgViewer/GraphicsWindowCarbon.cpp):

    ProcessSerialNumber sn = { 0, kCurrentProcess };
    TransformProcessType(&sn,kProcessTransformToForegroundApplication);
    SetFrontProcess(&sn);


it must be said that I'm not a Carbon hacker, so someone with better knowledge
of Carbon programming may see a more appropriate place for this.


(also: TransformProcessType was apparently introduced in OSX 10.3, don't know
how to do this for earlier versions)

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to