From eb5791e5e275fd33afe4f5e2b156c7d0441ab113 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 30 Apr 2015 13:59:24 +0000 Subject: [PATCH] From Dmitriy Ogalcev, fix for crash when calling setCursor from a non GUI thread git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14861 16af8721-9629-0410-8352-f15c8da7e697 --- src/osgViewer/GraphicsWindowWin32.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 378565d58..6e4adccce 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -2273,9 +2273,8 @@ void GraphicsWindowWin32::setCursorImpl( MouseCursor mouseCursor ) _currentCursor = newCursor; _traits->useCursor = (_currentCursor != NULL) && (_mouseCursor != NoCursor); - - if (_mouseCursor != InheritCursor) - ::SetCursor(_currentCursor); + + PostMessage(_hwnd, WM_SETCURSOR, 0, 0); } }