<div dir="ltr"><div><div><div>Hi Gianni,<br><br></div>It is appropriate for osgGA::EventQueue::setStartClick() to call clear() as otherwise the queue would end up with inconsistent time stamps, as existing events would have the wrong relative time.<br><br></div>The only alternative to this would be to reset all the event in the queue so that their time was reset relative to the previous and new start ticks.  However, the setStartClick is something done at initialization of the viewer, before event handling is meant to kick off, it's not something that is meant for after start up.<br></div><div><br></div><div>Personally I think the problem you are seeing is in osgWidget relying upon resize events at the start of the application, it really shouldn't rely upon this.  I'm not the author though so pinpointing what it should do would require sifting through the design and implementation to see a better approach.  Unfortunately I don't have the time to do this right now.<br></div><div><br></div>Robert.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 18 April 2016 at 11:19, Gianni Ambrosio <span dir="ltr"><<a href="mailto:g.ambrosio+osg@gmail.com" target="_blank">g.ambrosio+osg@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">OK, thanks Robert for the informations.<br>
So, just tio summarize the case for Cedric.<br>
When a Qt Application starts, most of Qt events (like resize, show, activate, ...) are sent to GLWidget before the OSG code handles them. GLWidget handles those events and queue them into OSG Eventqueue to be processed on the next frame() call. The problem in that the first call of ViewerBase::frame(double) calls setStartTick(osg::Timer::instance()->getStartTick()) (in realize() method) which clears the queued events. So this causes all events already queues not correctly handled.<br>
<br>
I found that setStartTick() call is used somewhere in OSG code. I can suggest to call eventQueue.clear() before setStartTick() separatedly when needed instead of calling it directly inside setStartTick() but I'm not aware of the overall OSG code and possible consequences.<br>
<br>
Hope this helps.<br>
<span class="">Gianni<br>
<br>
------------------<br>
Read this topic online here:<br>
</span><a href="http://forum.openscenegraph.org/viewtopic.php?p=66854#66854" rel="noreferrer" target="_blank">http://forum.openscenegraph.org/viewtopic.php?p=66854#66854</a><br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</a><br>
</div></div></blockquote></div><br></div>