From 529ea4c94f96daa47c226b15bc210101dea5c466 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Tue, 14 Jun 2011 09:16:44 +0000 Subject: [PATCH] From Stephan Huber, "attached you'll find a fix for the non-working useCursor()-method for Windows. With the old code you can switch off the cursor, but not back on." --- src/osgViewer/GraphicsWindowWin32.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 5010a7ef9..bbef9ce44 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -2102,11 +2102,12 @@ void GraphicsWindowWin32::setWindowName( const std::string & name ) void GraphicsWindowWin32::useCursor( bool cursorOn ) { - _traits->useCursor = cursorOn; - if (_traits->useCursor == false) - { - setCursor(NoCursor); - } + if (_traits.valid()) + _traits->useCursor = cursorOn; + + // note, we are using setCursorImpl to set the cursor, so we can use + // _appMouseCursor to cache the current mouse-cursor + setCursorImpl(cursorOn ? _appMouseCursor : NoCursor); } void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )