[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kwin
Subject:    Re: Review Request: Mouse Click Animation Effect
From:       Thomas_Lübking <thomas.luebking () web ! de>
Date:       2012-07-29 20:47:01
Message-ID: 20120729204701.27944.6090 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


> On July 29, 2012, 6:26 p.m., Thomas Lübking wrote:
> > kwin/effects/mouseclick/mouseclick.cpp, line 171
> > <http://git.reviewboard.kde.org/r/105780/diff/1/?file=75181#file75181line171>
> > 
> > Try to schedule the creation until the eventframe is actually requireTry to \
> > schedule the creation until the eventframe is actually required. 
> > Also some private members (such as m_font, m_ showText) seem only relevant for \
> > the MouseClick class -> access them from there (eg. make them static members, set \
> > them in the constructor and keep them there or so)
> 
> Filip Wieladek wrote:
> The effect frame will be required on the next render anyway. Not sure if it makes \
> sense to sacrifice a possible performance gain over readability and simplicity of \
> the code.  
> I have fixed a small issue where frames would be created even though they would not \
> be displayed (e.g. the user has turned them off)

> I have fixed a small issue where frames would be create...

That's pretty much what i meant in this regard, sorry for bad wording.


> On July 29, 2012, 6:26 p.m., Thomas Lübking wrote:
> > kwin/effects/mouseclick/mouseclick.cpp, line 305
> > <http://git.reviewboard.kde.org/r/105780/diff/1/?file=75181#file75181line305>
> > 
> > ++i, yes - gcc will silently fix it, nevertheless.
> 
> Filip Wieladek wrote:
> Picky, but fixed.

It's "wrong" and for non POD in a hot loop can become really expensive. That's why \
one should not get used to it. Postinc is only good if you want to use "i" as \
parameter and inc it right afterwards. Otherwise it's suboptimal (always - gcc, just \
sees this and replaces it with the preinc)

Another aspect is, that one will break reading about it ("what's special here?") when \
generally using preinc.


- Thomas


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/105780/#review16615
-----------------------------------------------------------


On July 29, 2012, 8:13 p.m., Filip Wieladek wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/105780/
> -----------------------------------------------------------
> 
> (Updated July 29, 2012, 8:13 p.m.)
> 
> 
> Review request for kwin.
> 
> 
> Description
> -------
> 
> I frequently have make screencasts (e.g. for video tutorials or filing bugs). One \
> missing feature on KDE was capturing mouse presses when doing screencasts or \
> presentations. It seems that at some point recorditnow did support mouse capture, \
> but that functionality no longer works.  
> I would propose to have a separate kwin effect which would do exactly that. I have \
> started on an effect and finished the initial version. The results can be seen in \
> the attached video. 
> Please let me know of any enhancements I can make. This is my first time writing a \
> KDE Effect. 
> Note: The CMakeLists is still configured to create a separate library. This is for \
> easier testing. if this effect would be integrated into Kwin builtin effects, I \
> would be more than happy to change it so it would be included into the built in \
> effects library.  
> 
> Diffs
> -----
> 
> kwin/effects/mouseclick/CMakeLists.txt PRE-CREATION 
> kwin/effects/mouseclick/mouseclick.cpp PRE-CREATION 
> kwin/effects/mouseclick/mouseclick.desktop PRE-CREATION 
> kwin/effects/mouseclick/mouseclick.h PRE-CREATION 
> kwin/effects/mouseclick/mouseclick_config.cpp PRE-CREATION 
> kwin/effects/mouseclick/mouseclick_config.desktop PRE-CREATION 
> kwin/effects/mouseclick/mouseclick_config.h PRE-CREATION 
> kwin/effects/mouseclick/mouseclick_config.ui PRE-CREATION 
> 
> Diff: http://git.reviewboard.kde.org/r/105780/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Filip Wieladek
> 
> 


[Attachment #5 (text/html)]

<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;">  <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="http://git.reviewboard.kde.org/r/105780/">http://git.reviewboard.kde.org/r/105780/</a>
  </td>
    </tr>
   </table>
   <br />








<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On July 29th, 2012, 6:26 p.m., <b>Thomas \
Lübking</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/105780/diff/1/?file=75181#file75181line171" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/effects/mouseclick/mouseclick.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">void MouseClickEffect::slotMouseChanged(const QPoint&amp; pos, const \
QPoint&amp;,</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">171</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">            \
<span class="n">m</span> <span class="o">=</span> <span class="k">new</span> <span \
class="n">MouseClick</span><span class="p">(</span><span class="n">i</span><span \
class="p">,</span> <span class="n">pos</span><span class="p">,</span> <span \
class="mi">0</span><span class="p">,</span> <span class="n">effects</span><span \
class="o">-&gt;</span><span class="n">effectFrame</span><span class="p">(</span><span \
class="n">EffectFrameStyled</span><span class="p">,</span> <span \
class="kc">false</span><span class="p">,</span> <span class="n">point</span><span \
class="p">,</span> <span class="n">Qt</span><span class="o">::</span><span \
class="n">AlignLeft</span><span class="p">),</span> <span class="kc">true</span><span \
class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Try to schedule the \
creation until the eventframe is actually requireTry to schedule the creation until \
the eventframe is actually required.

Also some private members (such as m_font, m_ showText) seem only relevant for the \
MouseClick class -&gt; access them from there (eg. make them static members, set them \
in the constructor and keep them there or so)</pre>  </blockquote>



 <p>On July 29th, 2012, 8:17 p.m., <b>Filip Wieladek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The effect frame will be \
required on the next render anyway. Not sure if it makes sense to sacrifice a \
possible performance gain over readability and simplicity of the code. 

I have fixed a small issue where frames would be created even though they would not \
be displayed (e.g. the user has turned them off)</pre>  </blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">&gt; I have \
fixed a small issue where frames would be create...

That&#39;s pretty much what i meant in this regard, sorry for bad wording.</pre>
<br />

<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <p style="margin-top: 0;">On July 29th, 2012, 6:26 p.m., <b>Thomas \
Lübking</b> wrote:</p>  <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">  



<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;">  <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;">  <a \
href="http://git.reviewboard.kde.org/r/105780/diff/1/?file=75181#file75181line305" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/effects/mouseclick/mouseclick.cpp</a>  <span style="font-weight: \
normal;">

     (Diff revision 1)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; \
"></pre></td>  <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: \
0; ">void MouseClickEffect::slotMouseChanged(const QPoint&amp; pos, const \
QPoint&amp;,</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2"></font></th>  <td bgcolor="#c5ffc4" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>  <th \
bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">305</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">    <span \
class="k">for</span><span class="p">(</span><span class="kt">int</span> <span \
class="n">ii</span> <span class="o">=</span> <span class="mi">0</span><span \
class="p">;</span> <span class="n">ii</span> <span class="o">&lt;</span> <span \
class="n">num_segments</span><span class="p">;</span> <span class="n">ii</span><span \
class="o">++</span><span class="p">)</span><span class="ew"> </span></pre></td>  \
</tr>

 </tbody>

</table>

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">++i, yes - gcc will \
silently fix it, nevertheless.</pre>  </blockquote>



 <p>On July 29th, 2012, 8:17 p.m., <b>Filip Wieladek</b> wrote:</p>
 <blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;">  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Picky, but fixed.</pre>  \
</blockquote>







</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It&#39;s \
&quot;wrong&quot; and for non POD in a hot loop can become really expensive. \
That&#39;s why one should not get used to it. Postinc is only good if you want to use \
&quot;i&quot; as parameter and inc it right afterwards. Otherwise it&#39;s suboptimal \
(always - gcc, just sees this and replaces it with the preinc)

Another aspect is, that one will break reading about it (&quot;what&#39;s special \
here?&quot;) when generally using preinc.</pre> <br />




<p>- Thomas</p>


<br />
<p>On July 29th, 2012, 8:13 p.m., Filip Wieladek wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;">  <tr>
  <td>

<div>Review request for kwin.</div>
<div>By Filip Wieladek.</div>


<p style="color: grey;"><i>Updated July 29, 2012, 8:13 p.m.</i></p>






<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
 <table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0">  <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">I frequently have make screencasts (e.g. for video tutorials or filing \
bugs). One missing feature on KDE was capturing mouse presses when doing screencasts \
or presentations. It seems that at some point recorditnow did support mouse capture, \
but that functionality no longer works. 

I would propose to have a separate kwin effect which would do exactly that. I have \
started on an effect and finished the initial version. The results can be seen in the \
attached video.

Please let me know of any enhancements I can make. This is my first time writing a \
KDE Effect.

Note: The CMakeLists is still configured to create a separate library. This is for \
easier testing. if this effect would be integrated into Kwin builtin effects, I would \
be more than happy to change it so it would be included into the built in effects \
library. </pre>  </td>
 </tr>
</table>





<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>kwin/effects/mouseclick/CMakeLists.txt <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick.desktop <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick_config.cpp <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick_config.desktop <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick_config.h <span style="color: \
grey">(PRE-CREATION)</span></li>

 <li>kwin/effects/mouseclick/mouseclick_config.ui <span style="color: \
grey">(PRE-CREATION)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/105780/diff/" style="margin-left: \
3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>



_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic