<div class="markdown_content"><hr/>
<p><strong> <a class="alink" href="https://sourceforge.net/p/pure-data/bugs/1298/">[bugs:#1298]</a> <code>motion</code> message emits canvas_doclick, is it useless?</strong></p>
<p><strong>Status:</strong> open<br/>
<strong>Group:</strong> v0.47<br/>
<strong>Created:</strong> Sat Jun 03, 2017 12:03 AM UTC by Giulio Moro<br/>
<strong>Last Updated:</strong> Sat Jun 03, 2017 12:03 AM UTC<br/>
<strong>Owner:</strong> nobody</p>
<p>In <code>g_editor.c</code>, <code>canvas_motion()</code> is called when the canvas receives a <code>motion</code> message. As far as I  can tell, this happens only when the mouse is moved on the GUI (and there is no click).</p>
<p>In a long chain of <code>if .. else if</code>, the last <code>else</code> is:</p>
<div class="codehilite"><pre>else
{
    canvas_doclick(x, xpos, ypos, 0, mod, 0);
}
</pre></div>


<p>The signature for <code>canvas_doclick()</code> is </p>
<div class="codehilite"><pre>void canvas_doclick(t_canvas *x, int xpos, int ypos, int which, int mod, int doit)
</pre></div>


<p>So the above call invokes it with <code>doit = 0</code>.</p>
<p>So, my points are:</p>
<p>1) why is <code>canvas_doclick</code> called when there is no click? This seems semantically wrong.<br/>
2) the above call always results in nothing being done (at least with the vanilla GUI objects), as they all do nothing when <code>doit == 0</code>  (as  you would expect).<br/>
3) So, it seems that the above call is useless. Unfortunately, it requires a lot of CPU time for patches with a large number of objects, as it calls <code>canvas_hitbox()</code> on every object in the patch.<br/>
4) Is there any reason why the call to <code>canvas_doclick(... doit = 0)</code> is there? can we take it out?</p>
<hr/>
<p>Sent from sourceforge.net because pd-dev@lists.iem.at is subscribed to <a href="https://sourceforge.net/p/pure-data/bugs/">https://sourceforge.net/p/pure-data/bugs/</a></p>
<p>To unsubscribe from further messages, a project admin can change settings at <a href="https://sourceforge.net/p/pure-data/admin/bugs/options.">https://sourceforge.net/p/pure-data/admin/bugs/options.</a>  Or, if this is a mailing list, you can unsubscribe from the mailing list.</p></div>