From Roland Smeenk, "Attached is a small bug fix for the redundant messages that are created in OSG applications on windows. GraphicsWindowWin32::setCursor is called every frame from the WM_NCHITTEST message. This will result in a call to ::SetCursor(_currentCursor) every frame, which again causes a WM_MOUSEMOVE to occur. The fix exits GraphicsWindowWin32::setCursor if the requested cursor already is the current cursor.

"

Merged from svn/trunk using:

svn merge -r 9823:9824 http://www.openscenegraph.org/svn/osg/OpenSceneGraph/trunk/src/osgViewer/GraphicsWindowWin32.cpp
This commit is contained in:
Robert Osfield
2009-02-27 11:14:04 +00:00
parent e68110f303
commit 339026a0f2

View File

@@ -1935,25 +1935,28 @@ void GraphicsWindowWin32::useCursor( bool cursorOn )
void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
{
if (mouseCursor != LeftRightCursor &&
mouseCursor != UpDownCursor &&
mouseCursor != TopLeftCorner &&
mouseCursor != TopRightCorner &&
mouseCursor != BottomLeftCorner &&
mouseCursor != BottomRightCorner)
if (_mouseCursor != mouseCursor)
{
_appMouseCursor = mouseCursor;
if (mouseCursor != LeftRightCursor &&
mouseCursor != UpDownCursor &&
mouseCursor != TopLeftCorner &&
mouseCursor != TopRightCorner &&
mouseCursor != BottomLeftCorner &&
mouseCursor != BottomRightCorner)
{
_appMouseCursor = mouseCursor;
}
_mouseCursor = mouseCursor;
HCURSOR newCursor = getOrCreateCursor( mouseCursor);
if (newCursor == _currentCursor) return;
_currentCursor = newCursor;
_traits->useCursor = (_currentCursor != NULL);
if (_mouseCursor != InheritCursor)
::SetCursor(_currentCursor);
}
_mouseCursor = mouseCursor;
HCURSOR newCursor = getOrCreateCursor( mouseCursor);
if (newCursor == _currentCursor) return;
_currentCursor = newCursor;
_traits->useCursor = (_currentCursor != NULL);
if (_mouseCursor != InheritCursor)
::SetCursor(_currentCursor);
}
HCURSOR GraphicsWindowWin32::getOrCreateCursor(MouseCursor mouseCursor)