[vtk-developers] VTK_CURSOR_DEFAULT unsets the cursor on vtkXOpenGLRenderWindow

Giuseppe D'Angelo giuseppe.dangelo at kdab.com
Tue Jan 29 11:35:43 EST 2013


Hello,

I'm working on a fix for http://paraview.org/Bug/view.php?id=13707 in 
VTK 5.10.1.

The nature of the bug is that the cursor inside a vtkXOpenGLRenderWindow 
is reset to the default cursor (usually an arrow, as XUndefineCursor 
gets called) as soon as it leaves a VTK widget that overrides it, f.i. 
with a "hand" cursor because the widget is able to be moved around. This 
happens because the widget asks for a VTK_CURSOR_DEFAULT when the cursor 
is not inside its boundaries.

I think this behaviour is wrong: the cursor should be reset to the one 
that has been set on the vtkRenderWindow, if any; hence my bug report.

I'm not 100% sure about where the fix should be applied, though. Given 
that widgets use VTK_CURSOR_DEFAULT to say "I'm not interested in 
overriding the cursor" and render windows instead interpret that as 
"unset any cursor that has been set", it seems to me that the most 
natural place to put the fix in the glue that holds the two things 
together, namely vtkObserverMediator::RequestCursorShape, which should 
somehow remember the renderWindow's cursor (when it overrides it the 
first time (?)) and then restore it back.

Or perhaps the meaning of SetCurrentCursor(VTK_CURSOR_DEFAULT) should be 
changed and another "UnsetCurrentCursor()" should be added.

Thoughts?

Thanks,
-- 
Giuseppe D'Angelo | giuseppe.dangelo at kdab.com | Software Engineer
KDAB (UK) Ltd., a KDAB Group company
Tel. UK +44-1738-450410, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions



More information about the vtk-developers mailing list