Hi Robert & Serge,
Here is the offending line:
void GraphicsWindowWin32::setCursorImpl( MouseCursor mouseCursor )
{
if (_mouseCursor != mouseCursor)
{
_mouseCursor = mouseCursor;
HCURSOR newCursor = getOrCreateCursor( mouseCursor);
if (newCursor == _currentCursor) return;
_currentCursor = newCursor;
_traits->useCursor = (_currentCursor != NULL); // Problem:
Changing useCursor when setCursorImpl is called
if (_mouseCursor != InheritCursor)
::SetCursor(_currentCursor);
}
}
It looks like this line isn't really necessary, but if it is desired to
change the useCursor mode when a cursor is set, it should be done in
setCursor, and not setCursorImpl.
void GraphicsWindowWin32::setCursor( MouseCursor mouseCursor )
{
_appMouseCursor = mouseCursor;
setCursorImpl(mouseCursor);
_traits->useCursor = (_currentCursor != NULL); // Line belongs
here instead (if this behavior is desired).
}
From a design perspective, I think useCursor and setCursor methods
should be orthogonal. Changing a cursor should not affect the useCursor
state of the window. Orthogonal designs tend to be more flexible. So if
it were up to me, I would simply delete the line with the result of a
slight change in semantics of the setCursor function.
Serge, try moving the indicated line to the indicated function. If that
doesn't work, delete it entirely. Some other code may be calling
setCursor behind your back and turning it back on.
Regards,
Mark
Robert Osfield wrote:
Hi Serge,
Good to hear you got it working, useCursor(false) should still work
though... so that is a bug. Can you say which versions of the OSG
that useCursor(false) was still working on? Have you tried out other
platforms?
Robert.
On Fri, Jun 12, 2009 at 7:22 PM, Serge Lages<serge.la...@gmail.com> wrote:
I have an update, using :
osgViewer::ViewerBase::Windows windows;
viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr !=
windows.end(); ++itr)
{
//(*itr)->useCursor(false);
(*itr)->setCursor(osgViewer::GraphicsWindow::MouseCursor::NoCursor);
}
Instead of setting useCursor(false) works, the cursor is invisible.
On Fri, Jun 12, 2009 at 12:23 PM, Serge Lages <serge.la...@gmail.com> wrote:
Hi all,
Currently (the SVN version of OSG), hidding the cursor under Windows has
no effect. Setting cursor to false on the traits or making something like :
osgViewer::ViewerBase::Windows windows;
viewer.getWindows(windows);
for (osgViewer::ViewerBase::Windows::iterator itr = windows.begin(); itr
!= windows.end(); ++itr)
{
(*itr)->useCursor(false);
}
Doesn't work, I always see the cursor...
Any idea on which modification has break things ? The same code was
working for me some weeks ago, but I can't tell which revision it was...
Thanks !
Best regards,
--
Serge Lages
http://www.tharsis-software.com
--
Serge Lages
http://www.tharsis-software.com
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org