From 3a656368932c3c3cc5321596e6c8c7554f1d7e61 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 25 Jun 2009 16:12:58 +0000 Subject: [PATCH] From Stephan Huber, fixes to Cocoa support --- src/osgViewer/DarwinUtils.mm | 4 ++-- src/osgViewer/GraphicsWindowCocoa.mm | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osgViewer/DarwinUtils.mm b/src/osgViewer/DarwinUtils.mm index 09b09944d..f8d59f7d3 100755 --- a/src/osgViewer/DarwinUtils.mm +++ b/src/osgViewer/DarwinUtils.mm @@ -145,7 +145,7 @@ void MenubarController::update() ++i; } else - i= _list.erase(i); + i = _list.erase(i); } // if we use the cocoa implementation then we have a NSRunLoop in place, and so we can use the deferred menubar-toggling which is thread safe @@ -182,7 +182,7 @@ void MenubarController::update() { error = SetSystemUIMode(kUIModeAllHidden, kUIOptionAutoShowMenuBar); } - else + if (!windowsCoveringMenubarArea && !_menubarShown) { error = SetSystemUIMode(kUIModeNormal, 0); } diff --git a/src/osgViewer/GraphicsWindowCocoa.mm b/src/osgViewer/GraphicsWindowCocoa.mm index 83326a3a4..b9b46589c 100755 --- a/src/osgViewer/GraphicsWindowCocoa.mm +++ b/src/osgViewer/GraphicsWindowCocoa.mm @@ -19,9 +19,9 @@ #include "DarwinUtils.h" -#define DEBUG_OUT(s) std::cout << "GraphicsWindowCocoa :: " << s << std::endl; +//#define DEBUG_OUT(s) std::cout << "GraphicsWindowCocoa :: " << s << std::endl; -//#define DEBUG_OUT(s) ; +#define DEBUG_OUT(s) ; static bool s_quit_requested = false; @@ -43,8 +43,8 @@ class CocoaKeyboardMap { CocoaKeyboardMap() { _keymap[27] = osgGA::GUIEventAdapter::KEY_Escape; - _keymap[13] = osgGA::GUIEventAdapter::KEY_KP_Enter; - _keymap[3] = osgGA::GUIEventAdapter::KEY_Return; + _keymap[13] = osgGA::GUIEventAdapter::KEY_Return; + _keymap[3] = osgGA::GUIEventAdapter::KEY_KP_Enter; _keymap[9] = osgGA::GUIEventAdapter::KEY_Tab; _keymap[32] = osgGA::GUIEventAdapter::KEY_Space; _keymap[127] = osgGA::GUIEventAdapter::KEY_BackSpace;