<div dir="ltr"><div class="gmail_default" style="font-family:tahoma,sans-serif">Hi all,</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I report what I believe could be considered a bug, probably introduced after the promotion of the Drawable class to a node, together with the new callback system.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">I have a GUIEventHandler derived class installed on a Drawable.</div><div class="gmail_default" style="font-family:tahoma,sans-serif">After some digging I've realized that it's called twice for every event due to the EventVisitor code here: <a href="https://github.com/openscenegraph/OpenSceneGraph/blob/master/include/osgGA/EventVisitor#L86" target="_blank">https://github.com/<wbr>openscenegraph/OpenSceneGraph/<wbr>blob/master/include/osgGA/<wbr>EventVisitor#L86</a></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">GUIEventHandler happens to derive both from NodeCallback and DrawableEventCallback, resulting in it being called twice. I think this might be considered as a bug if the intended behavior was to keep using the old GUIEventHandler interface the way it was (when attached to the viewer for instance, it is called only once as expected).</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Relate issue:</div><div class="gmail_default" style="font-family:tahoma,sans-serif">I've re-implemented my callback deriving from osg::Callback, but this results in a crash as the osg::CallbackObject interface is used even if the cast does not succeed (first if condition)</div><div class="gmail_default" style=""><font face="tahoma, sans-serif"><a href="https://github.com/openscenegraph/OpenSceneGraph/blob/master/include/osgGA/EventVisitor#L93">https://github.com/openscenegraph/OpenSceneGraph/blob/master/include/osgGA/EventVisitor#L93</a></font><br></div><div class="gmail_default" style=""><font face="tahoma, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="tahoma, sans-serif">I fixed that by deriving from osg::NodeCallback, but I had to reimplement the operator() method instead of run(), as the second is not called by the visitor - that also it's a bit counter-intuitive with respect to the osg::Callback class interface.</font></div><div class="gmail_default" style=""><font face="tahoma, sans-serif"><br></font></div><div class="gmail_default" style=""><font face="tahoma, sans-serif">Ricky</font></div><div class="gmail_default" style=""><br></div><div class="gmail_default" style=""><font face="tahoma, sans-serif"><br></font></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br></div></div>