<table><tr><td style="">romangg added a comment.<br />Restricted Application edited projects, added KWin; removed Plasma.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10291" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>Note that it gave me some error, when I tried to compile this branch.</p>
<p><tt style="background: #ebebeb; font-size: 13px;">UpdateRecursionBlocker</tt> has a generic name, but it is dependent on receiving as <tt style="background: #ebebeb; font-size: 13px;">T</tt> one of the input classes with <tt style="background: #ebebeb; font-size: 13px;">input</tt> as an instance and having a member function <tt style="background: #ebebeb; font-size: 13px;">update</tt>. I would make it fully generic by adding a std::function type argument to the constructer (that in our current application encapsulates <tt style="background: #ebebeb; font-size: 13px;">input->update()</tt>) and that gets called in the destructor just like it is now. The template parameter <tt style="background: #ebebeb; font-size: 13px;">T</tt> would then be the template argument of the std::function argument and m_input would be replaced by a member variable <tt style="background: #ebebeb; font-size: 13px;">m_fct</tt> storing the std::function</p>
<p>The class does not directly block recursions, but delays additional calls to the end of the first call (and then does the call only once). Therefore I would name it differently. Something like <tt style="background: #ebebeb; font-size: 13px;">BlockAndDelayCallsToOne</tt>?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10291" rel="noreferrer">https://phabricator.kde.org/D10291</a></div></div><br /><div><strong>To: </strong>graesslin, KWin, Plasma<br /><strong>Cc: </strong>romangg, plasma-devel, kwin, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart<br /></div>