Index: /OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa
===================================================================
--- /OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa (revision 9879)
+++ /OpenSceneGraph/trunk/include/osgViewer/api/Cocoa/GraphicsWindowCocoa (revision 10208)
@@ -24,10 +24,14 @@
 #ifdef __OBJC__
 @class GraphicsWindowCocoaWindow;
+@class GraphicsWindowCocoaGLView;
 @class NSOpenGLContext;
 @class NSWindow;
+@class NSView;
 #else
+class GraphicsWindowCocoaGLView;
 class GraphicsWindowCocoaWindow;
 class NSOpenGLContext;
 class NSWindow;
+class NSView;
 #endif
 
@@ -42,5 +46,5 @@
 {
     public:
-	class Implementation;
+    class Implementation;
 
         GraphicsWindowCocoa(osg::GraphicsContext::Traits* traits):
@@ -48,6 +52,10 @@
             _initialized(false),
             _realized(false),
+            _closeRequested(false),
+            _checkForEvents(true),
             _ownsWindow(true),
-            _currentCursor(RightArrowCursor)
+            _currentCursor(RightArrowCursor),
+            _window(NULL),
+            _context(NULL)
         {
             _traits = traits;
@@ -122,15 +130,27 @@
         {
             public:
-                WindowData(NSWindow* window)
-				:	_window(window) 
-				{
-				}
-                
-                inline NSWindow* getNativeWindowRef() { return _window; }
-                                
+                enum Options { CreateOnlyView = 1, CheckForEvents = 2, PoseAsStandaloneApp = 4};
+                WindowData(unsigned int options)
+                :    _createOnlyView(options & CreateOnlyView),
+                    _checkForEvents(options & CheckForEvents),
+                    _poseAsStandaloneApp(options & PoseAsStandaloneApp),
+                    _view(NULL)
+                {
+                }
+                            
+                inline NSView* getCreatedNSView() { return _view; }
+                bool createOnlyView() const { return _createOnlyView; }
+                bool checkForEvents() const { return _checkForEvents; }
+                bool poseAsStandaloneApp() const { return _poseAsStandaloneApp; }
+            
+            protected:
+                inline void setCreatedNSView(NSView* view) { _view = view; }
+            
             private:
-                NSWindow*    _window;
-                bool         _installEventHandler;
+                bool         _createOnlyView, _checkForEvents, _poseAsStandaloneApp;
+                NSView*         _view;
             
+            friend class GraphicsWindowCocoa;
+
         };
         
@@ -139,7 +159,7 @@
                 
         void setVSync(bool f);
-		
-		/** adapts a resize / move of the window, coords in global screen space */
-		void adaptResize(int x, int y, int w, int h);
+        
+        /** adapts a resize / move of the window, coords in global screen space */
+        void adaptResize(int x, int y, int w, int h);
         
     protected:
@@ -158,15 +178,15 @@
         bool            _realized;
         bool            _useWindowDecoration;
-        bool            _ownsWindow;
 
-	
+    
          
     private:        
        
         
-        bool				_closeRequested;
-        MouseCursor			_currentCursor;
-		GraphicsWindowCocoaWindow* _window;
-		NSOpenGLContext*	_context;
+        bool                _closeRequested, _checkForEvents,_ownsWindow;
+        MouseCursor            _currentCursor;
+        GraphicsWindowCocoaWindow* _window;
+        GraphicsWindowCocoaGLView*    _view;
+        NSOpenGLContext*    _context;
 };
 
Index: /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.h
===================================================================
--- /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.h (revision 9895)
+++ /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.h (revision 10208)
@@ -79,14 +79,11 @@
 
         virtual void enumerateScreenSettings(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, osg::GraphicsContext::ScreenSettingsList & resolutionList);
+        
+        virtual bool setScreenSettings (const osg::GraphicsContext::ScreenIdentifier & si, const osg::GraphicsContext::ScreenSettings & settings);
 
         /** return the top left coord of a specific screen in global screen space */
         void getScreenTopLeft(const osg::GraphicsContext::ScreenIdentifier& si, int& x, int& y);
 
-        /** implementation of setScreenResolution */
-        virtual bool setScreenResolution(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) ;
-
-        /** implementation of setScreenRefreshRate */
-        virtual bool setScreenRefreshRate(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate);
-
+        
 
         /** returns screen-ndx containing rect x,y,w,h */
@@ -94,4 +91,11 @@
     
     protected:
+    
+        /** implementation of setScreenResolution */
+        bool setScreenResolutionImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) ;
+
+        /** implementation of setScreenRefreshRate */
+        bool setScreenRefreshRateImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate);
+
     
         template<class PixelBufferImplementation, class GraphicsWindowImplementation>
Index: /OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm
===================================================================
--- /OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm (revision 9895)
+++ /OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowCocoa.mm (revision 10208)
@@ -8,4 +8,6 @@
  *  Some code borrowed from the implementation of CocoaViewer, 
  *  Created by Eric Wing on 11/12/06. and ported by Martin Lavery 7/06/07
+ *
+ *  Other snippets are borrowed from the Cocoa-implementation of the SDL-lib
  */
 
@@ -18,6 +20,15 @@
 #include "DarwinUtils.h"
 
+//#define DEBUG_OUT(s) std::cout << "GraphicsWindowCocoa :: " << s << std::endl;
+
+#define DEBUG_OUT(s) ;
 
 static bool s_quit_requested = false;
+
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
+@interface NSApplication(NSAppleMenu)
+- (void)setAppleMenu:(NSMenu *)menu;
+@end
+#endif
 
 
@@ -188,4 +199,5 @@
 
 - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender;
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification;
 @end
 
@@ -194,6 +206,11 @@
 {
     s_quit_requested = true;
-    // std::cout << "quit requested " << std::endl;
-    return NSTerminateNow;
+    DEBUG_OUT("quit requested ");
+    return NSTerminateCancel;
+}
+
+- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
+{
+    DEBUG_OUT("applicationDidFinishLaunching");
 }
 
@@ -323,4 +340,9 @@
 - (void) handleModifiers: (NSEvent*)theEvent
 {
+    DEBUG_OUT("handling modifiers");
+    
+    if ((!_win) || (!_win->getEventQueue())) 
+        return; // no event    queue in place
+    
     unsigned int flags = [theEvent modifierFlags];
     
@@ -367,4 +389,5 @@
 - (void) mouseMoved:(NSEvent*)theEvent 
 {
+    DEBUG_OUT("Mouse moved");
     NSPoint converted_point = [self getLocalPoint: theEvent];
     _win->getEventQueue()->mouseMotion(converted_point.x, converted_point.y);
@@ -375,4 +398,5 @@
 - (void) mouseDown:(NSEvent*)theEvent
 {
+    DEBUG_OUT("Mouse down");
     // Because many Mac users have only a 1-button mouse, we should provide ways
     // to access the button 2 and 3 actions of osgViewer.
@@ -403,4 +427,6 @@
 - (void) mouseDragged:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];    
     _win->getEventQueue()->mouseMotion(converted_point.x, converted_point.y);
@@ -441,5 +467,6 @@
 - (void) rightMouseDragged:(NSEvent*)theEvent
 {
-   
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     _win->getEventQueue()->mouseMotion(converted_point.x, converted_point.y);
@@ -473,4 +500,6 @@
 - (void) otherMouseDragged:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];    
     _win->getEventQueue()->mouseMotion(converted_point.x, converted_point.y);
@@ -524,4 +553,6 @@
 - (void) doLeftMouseButtonDown:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     
@@ -538,4 +569,6 @@
 - (void) doLeftMouseButtonUp:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     
@@ -546,4 +579,6 @@
 - (void) doRightMouseButtonDown:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     if([theEvent clickCount] == 1)
@@ -561,4 +596,6 @@
 - (void) doRightMouseButtonUp:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];    
     _win->getEventQueue()->mouseButtonRelease(converted_point.x, converted_point.y, 3);
@@ -567,4 +604,6 @@
 - (void) doMiddleMouseButtonDown:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     
@@ -581,4 +620,6 @@
 - (void) doExtraMouseButtonDown:(NSEvent*)theEvent buttonNumber:(int)button_number
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     if([theEvent clickCount] == 1)
@@ -595,4 +636,6 @@
 - (void) doMiddleMouseButtonUp:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     _win->getEventQueue()->mouseButtonRelease(converted_point.x, converted_point.y, 2);
@@ -602,4 +645,6 @@
 - (void) doExtraMouseButtonUp:(NSEvent*)theEvent buttonNumber:(int)button_number
 {
+    if (!_win) return;
+    
     NSPoint converted_point = [self getLocalPoint: theEvent];
     _win->getEventQueue()->mouseButtonRelease(converted_point.x, converted_point.y, button_number+1);
@@ -610,4 +655,6 @@
 - (void) scrollWheel:(NSEvent*)theEvent
 {
+    if (!_win) return;
+    
     // Unfortunately, it turns out mouseScroll2D doesn't actually do anything.
     // The camera manipulators don't seem to implement any code that utilize the scroll values.
@@ -620,4 +667,6 @@
 - (void)keyDown:(NSEvent *)theEvent 
 {
+    if (!_win) return;
+    
     NSString* chars = [theEvent charactersIgnoringModifiers]; 
     unsigned int keyCode = remapCocoaKey([chars characterAtIndex:0], ([theEvent modifierFlags] & NSFunctionKeyMask) );
@@ -629,4 +678,6 @@
 - (void)keyUp:(NSEvent *)theEvent 
 {   
+    if (!_win) return;
+    
     NSString* chars = [theEvent charactersIgnoringModifiers]; 
     unsigned int keyCode = remapCocoaKey([chars characterAtIndex:0], ([theEvent modifierFlags] & NSFunctionKeyMask));
@@ -644,4 +695,6 @@
 -(void)handleTabletEvents:(NSEvent *)theEvent
 {
+    if (!_win) return;
+    
     float pressure = [theEvent pressure];
     _win->getEventQueue()->penPressure(pressure);
@@ -654,4 +707,6 @@
 - (void)tabletProximity:(NSEvent *)theEvent
 {
+    if (!_win) return;
+    
     osgGA::GUIEventAdapter::TabletPointerType pt(osgGA::GUIEventAdapter::UNKNOWN);
     switch ([theEvent pointingDeviceType]) {
@@ -845,14 +900,32 @@
     NSRect rect = NSMakeRect(_traits->x + screenLeft, _traits->y + screenTop, _traits->width, _traits->height);
     
-    _window = [[GraphicsWindowCocoaWindow alloc] initWithContentRect: rect styleMask: style backing: NSBackingStoreBuffered defer: NO];
-    
-    if (!_window) {
-        osg::notify(osg::WARN) << "GraphicsWindowCocoa::realizeImplementation :: could not create window" << std::endl;
-        return false;
-    }
-    
-    rect = convertFromQuartzCoordinates(rect);
-    [_window setFrameOrigin: rect.origin];
-     
+    _ownsWindow = true;
+    
+    // should we create a NSView only??
+    WindowData* windowData = _traits->inheritedWindowData ? dynamic_cast<WindowData*>(_traits->inheritedWindowData.get()) : NULL;
+    if (windowData) 
+    {
+        if (windowData->createOnlyView())
+            _ownsWindow = false;
+        _checkForEvents = windowData->checkForEvents();
+        
+    } 
+    
+
+    osg::notify(osg::DEBUG_INFO) << "GraphicsWindowCocoa::realizeImplementation / ownsWindow: " << _ownsWindow << " checkForEvents: " << _checkForEvents << std::endl;
+
+    if (_ownsWindow) 
+    {
+        _window = [[GraphicsWindowCocoaWindow alloc] initWithContentRect: rect styleMask: style backing: NSBackingStoreBuffered defer: NO];
+        
+        if (!_window) {
+            osg::notify(osg::WARN) << "GraphicsWindowCocoa::realizeImplementation :: could not create window" << std::endl;
+            return false;
+        }
+
+        rect = convertFromQuartzCoordinates(rect);
+        [_window setFrameOrigin: rect.origin];
+    } 
+            
     NSOpenGLPixelFormatAttribute attr[32];
     int i = 0;
@@ -914,12 +987,21 @@
     [theView setGraphicsWindowCocoa: this];
     [theView setOpenGLContext:_context];
-    [_window setContentView: theView];
-    
-    setupNSWindow(_window);
-    
-    [theView release];
+    _view = theView;
+    osg::notify(osg::DEBUG_INFO) << "GraphicsWindowCocoa::realizeImplementation / view: " << theView << std::endl;
+
+    if (_ownsWindow) {
+        [_window setContentView: theView];
+        setupNSWindow(_window);
+        [theView release];
+        
+        MenubarController::instance()->attachWindow( new CocoaWindowAdapter(this) );
+    }
+    else 
+    {
+        windowData->setCreatedNSView(theView);
+    }
+
     [pool release];
     
-    MenubarController::instance()->attachWindow( new CocoaWindowAdapter(this) );
     
     useCursor(_traits->useCursor);
@@ -951,6 +1033,16 @@
     if (mbc) mbc->detachWindow(this);
     
-    [_window close];
-    [_window release];
+    if (_window) {
+        [_window close];
+        [_window release];
+    }
+    
+    if (_view) {
+        [_view setGraphicsWindowCocoa: NULL];
+    }
+    
+    _window = NULL;
+    _view = NULL;
+    
 }
 
@@ -994,4 +1086,7 @@
 void GraphicsWindowCocoa::checkEvents()
 {
+    if (!_checkForEvents)
+        return;
+    
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     
@@ -1005,5 +1100,5 @@
             so it may not effectively make much of a difference.
          */
-        NSEvent *event = [ [NSApplication sharedApplication]
+        NSEvent *event = [ NSApp
                 nextEventMatchingMask:NSAnyEventMask
                 untilDate:[NSDate distantPast]
@@ -1012,5 +1107,5 @@
         if(!event)
             break;
-        [[NSApplication sharedApplication] sendEvent: event];
+        [NSApp sendEvent: event];
     }    
     
@@ -1037,5 +1132,7 @@
 bool GraphicsWindowCocoa::setWindowDecorationImplementation(bool flag)
 {
-    if (!_realized) return false;
+    if (!_realized || !_ownsWindow) return false;
+    
+    NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
     
     unsigned int style(NSBorderlessWindowMask);
@@ -1062,4 +1159,6 @@
     }
     
+    [localPool release];
+    
     return true;
 }
@@ -1071,5 +1170,6 @@
 void GraphicsWindowCocoa::grabFocus()
 {
-    [_window makeKeyAndOrderFront: nil];
+    if (_ownsWindow)
+        [_window makeKeyAndOrderFront: nil];
 }
 
@@ -1090,10 +1190,14 @@
 void GraphicsWindowCocoa::resizedImplementation(int x, int y, int width, int height)
 {
-    std::cout << "resized implementation" << x << " " << y << " " << width << " " << height << std::endl; 
+    DEBUG_OUT("resized implementation" << x << " " << y << " " << width << " " << height); 
     GraphicsContext::resizedImplementation(x, y, width, height);
+    
+    NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
    
-    [_context update];
+    if (_context)
+        [_context update];
     MenubarController::instance()->update();
     getEventQueue()->windowResize(x,y,width, height, getEventQueue()->getTime());
+    [localPool release];
 }
 
@@ -1106,4 +1210,9 @@
 bool GraphicsWindowCocoa::setWindowRectangleImplementation(int x, int y, int width, int height)
 {
+    if (!_ownsWindow)
+        return false;
+        
+    NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
+        
     DarwinWindowingSystemInterface* wsi = dynamic_cast<DarwinWindowingSystemInterface*>(osg::GraphicsContext::getWindowingSystemInterface());
     int screenLeft(0), screenTop(0);
@@ -1120,4 +1229,6 @@
     MenubarController::instance()->update();
     
+    [localPool release];
+    
     return true;
 }
@@ -1155,4 +1266,9 @@
 void GraphicsWindowCocoa::setWindowName (const std::string & name)
 {
+    if (_traits.valid()) _traits->windowName = name;
+    
+    if (!_ownsWindow)
+        return;
+        
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     
@@ -1201,4 +1317,6 @@
 void GraphicsWindowCocoa::setCursor(MouseCursor mouseCursor)
 {
+    NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
+    
     switch (mouseCursor) 
     {
@@ -1223,4 +1341,6 @@
             osg::notify(osg::INFO) << "GraphicsWindowCocoa::setCursor :: unsupported MouseCursor: " << mouseCursor << std::endl;    
     }
+    
+    [localPool release];
 }
 
@@ -1243,4 +1363,5 @@
 GraphicsWindowCocoa::~GraphicsWindowCocoa() 
 {
+    close();
 }
 
@@ -1256,12 +1377,50 @@
     
     CocoaWindowingSystemInterface()
-    :    DarwinWindowingSystemInterface() 
-    {
-        localPool = [[NSAutoreleasePool alloc] init];
-        [[NSApplication sharedApplication] setDelegate: [[CocoaAppDelegate alloc] init] ];
+    :    DarwinWindowingSystemInterface()
+    
+    {        
+    }
+    
+    void initAsStandaloneApplication() 
+    {
+        static bool s_inited = false;
+        if (s_inited) return;
+        s_inited = true;
+        
+        osg::notify(osg::INFO) << "CocoaWindowingSystemInterface::initAsStandaloneApplication " << std::endl;
+        
+        ProcessSerialNumber psn;
+        if (!GetCurrentProcess(&psn)) {
+            TransformProcessType(&psn, kProcessTransformToForegroundApplication);
+            SetFrontProcess(&psn);
+        }
+        
+        NSAutoreleasePool* localPool = [[NSAutoreleasePool alloc] init];
+        
+        if (NSApp == nil) {
+            [NSApplication sharedApplication];
+        }
+        
+        [NSApp setDelegate: [[CocoaAppDelegate alloc] init] ];
+        
+        createApplicationMenus();
+        
+        [NSApp finishLaunching];
+        
+        [localPool release];
     }
     
     virtual osg::GraphicsContext* createGraphicsContext(osg::GraphicsContext::Traits* traits) 
     {
+        if (!traits->pbuffer) 
+        {
+            GraphicsWindowCocoa::WindowData* windowData = traits->inheritedWindowData ? dynamic_cast<GraphicsWindowCocoa::WindowData*>(traits->inheritedWindowData.get()) : NULL;
+        
+            if (!windowData || (windowData && windowData->poseAsStandaloneApp())) 
+            {
+                initAsStandaloneApplication();
+            }
+        }
+        
         return createGraphicsContextImplementation<PixelBufferCocoa, GraphicsWindowCocoa>(traits);
     }
@@ -1269,11 +1428,78 @@
     virtual ~CocoaWindowingSystemInterface() 
     {
-        [localPool release];
-    }
-    
-    NSAutoreleasePool *localPool;
+    }
+    
+private:
+    NSString *getApplicationName(void)
+    {
+        NSDictionary *dict;
+        NSString *appName = 0;
+
+        /* Determine the application name */
+        dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
+        if (dict)
+            appName = [dict objectForKey: @"CFBundleName"];
+        
+        if (![appName length])
+            appName = [[NSProcessInfo processInfo] processName];
+
+        return appName;
+    }
+    
+     void createApplicationMenus(void)
+    {
+        NSString *appName;
+        NSString *title;
+        NSMenu *appleMenu;
+        NSMenuItem *menuItem;
+        
+        /* Create the main menu bar */
+        [NSApp setMainMenu:[[NSMenu alloc] init]];
+
+        /* Create the application menu */
+        appName = getApplicationName();
+        appleMenu = [[NSMenu alloc] initWithTitle:@""];
+        
+        /* Add menu items */
+        title = [@"About " stringByAppendingString:appName];
+        [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
+
+        [appleMenu addItem:[NSMenuItem separatorItem]];
+        
+        NSMenu* service_menu = [[NSMenu alloc] init];
+        NSMenuItem* service_menu_item = [[NSMenuItem alloc] initWithTitle:@"Services" action:nil keyEquivalent:@""];
+        [service_menu_item setSubmenu: service_menu];
+        [appleMenu addItem: service_menu_item];
+        [NSApp setServicesMenu: service_menu];
+        
+        [appleMenu addItem:[NSMenuItem separatorItem]];
+
+        title = [@"Hide " stringByAppendingString:appName];
+        [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@/*"h"*/"h"];
+
+        menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@/*"h"*/""];
+        [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
+
+        [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
+
+        [appleMenu addItem:[NSMenuItem separatorItem]];
+
+        title = [@"Quit " stringByAppendingString:appName];
+        [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@/*"q"*/"q"];
+        
+        /* Put menu into the menubar */
+        menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
+        [menuItem setSubmenu:appleMenu];
+        [[NSApp mainMenu] addItem:menuItem];
+        [menuItem release];
+
+        /* Tell the application object that this is now the application menu */
+        [NSApp setAppleMenu:appleMenu];
+        [appleMenu release];
+
+
+    }
 
 };
-
 
 }
Index: /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm
===================================================================
--- /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm (revision 9895)
+++ /OpenSceneGraph/trunk/src/osgViewer/DarwinUtils.mm (revision 10208)
@@ -249,7 +249,17 @@
 
 
+bool DarwinWindowingSystemInterface::setScreenSettings(const osg::GraphicsContext::ScreenIdentifier &si, const osg::GraphicsContext::ScreenSettings & settings)
+{
+    bool result = setScreenResolutionImpl(si, settings.width, settings.height);
+    if (result)
+        setScreenRefreshRateImpl(si, settings.refreshRate);
+    
+    return result;
+}
+
+
 
 /** implementation of setScreenResolution */
-bool DarwinWindowingSystemInterface::setScreenResolution(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) 
+bool DarwinWindowingSystemInterface::setScreenResolutionImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, unsigned int width, unsigned int height) 
 { 
     CGDirectDisplayID displayID = getDisplayID(screenIdentifier);
@@ -271,5 +281,5 @@
 
 /** implementation of setScreenRefreshRate */
-bool DarwinWindowingSystemInterface::setScreenRefreshRate(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate) { 
+bool DarwinWindowingSystemInterface::setScreenRefreshRateImpl(const osg::GraphicsContext::ScreenIdentifier& screenIdentifier, double refreshRate) { 
     
     boolean_t  success(false);
