From 7e0184f080a056b6dae7f0fddc3909c33102622c Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Wed, 28 May 2008 13:45:40 +0000 Subject: [PATCH] From Thibault Genessay, "On Windows, when setting a cursor through osgViewer::GraphicsWindow::setCursor() the new cursor type is recorded but not applied until windows sends another WM_SETCURSOR message. This delays the application of the cursor to the next mouse event. The attached file fixes this by setting the new cursor with a call to ::SetCursor() immediately. " --- src/osgViewer/GraphicsWindowWin32.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/osgViewer/GraphicsWindowWin32.cpp b/src/osgViewer/GraphicsWindowWin32.cpp index 10c12bccd..501125bb1 100644 --- a/src/osgViewer/GraphicsWindowWin32.cpp +++ b/src/osgViewer/GraphicsWindowWin32.cpp @@ -1847,6 +1847,9 @@ void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor ) _currentCursor = newCursor; _traits->useCursor = (_currentCursor != NULL); + + if (_mouseCursor != InheritCursor) + ::SetCursor(_currentCursor); } HCURSOR GraphicsWindowWin32::getOrCreateCursor(MouseCursor mouseCursor)