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

List:       kwin
Subject:    Re: Review Request: Move Workspace's compositing functionality to own class Compositor
From:       Thomas_Lübking <thomas.luebking () web ! de>
Date:       2012-05-02 18:50:43
Message-ID: 20120502185043.27600.44980 () vidsolbach ! de
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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



kwin/activation.cpp
<http://git.reviewboard.kde.org/r/102420/#comment10425>

    make compositor() a global function returning Workspace::self()->compositor()?



kwin/bridge.cpp
<http://git.reviewboard.kde.org/r/102420/#comment10426>

    and is compositingActive() actually required with this design (should the \
presence of the compositor not indicate it's active?) - iff, we'd rather need \
"isDying()" on destruction (for threadsand is compositingActive() actually required \
with this design (should the presence of the compositor not indicate it's active?) - \
iff, we'd rather need "isDying()" on destruction (for threads)  
    Right now it seems m_compositor is just some heap memory that follows the \
lifetime of workspace, but if it would be deleted on toggling the compositor (and the \
pointer nulled before calling the deconstructor*) this would end up being less \
cumbersome, yesno?  
    *
    Compositor *comp = m_compositor;
    m_compositor = NULL;
    delete comp;
    
    This way you could also spare the m_finishingCompositing and compositing() flags



kwin/events.cpp
<http://git.reviewboard.kde.org/r/102420/#comment10428>

    since scene is now controlled by the compositor instance, this should be \
redundant, ie. if there's m_compositor compositing() should implicitly be true \
(afaics...)



kwin/events.cpp
<http://git.reviewboard.kde.org/r/102420/#comment10429>

    "startCompositeResetTimer" ...



kwin/workspace.cpp
<http://git.reviewboard.kde.org/r/102420/#comment10424>

    Why wrap this in a slot instead of making it one?


- Thomas Lübking


On May 2, 2012, 4:19 p.m., Arthur Arlt wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102420/
> -----------------------------------------------------------
> 
> (Updated May 2, 2012, 4:19 p.m.)
> 
> 
> Review request for kwin.
> 
> 
> Description
> -------
> 
> This patch moves all the Workspace functionality implemented in file composite.cpp \
> to its own class Compositor. A new header file composite.h was created as well. All \
> function calls were updated. Maybe the shortcut set to the slot \
> 'slotToggleCompositing' in kwinbinding.cpp could be connected directly to the slot \
> in class Compositor. At the moment it is redirected from Workspace. 
> 
> Diffs
> -----
> 
> kwin/composite.h PRE-CREATION 
> kwin/client.cpp 410ff43 
> kwin/activation.cpp 451394f 
> kwin/bridge.cpp 897d432 
> kwin/composite.cpp 6a27e00 
> kwin/effects.cpp 8e73780 
> kwin/events.cpp cb397b2 
> kwin/geometry.cpp 92a23e3 
> kwin/layers.cpp ed8555c 
> kwin/toplevel.cpp 00bd7dd 
> kwin/workspace.h 9df435c 
> kwin/workspace.cpp b5c8014 
> 
> Diff: http://git.reviewboard.kde.org/r/102420/diff/
> 
> 
> Testing
> -------
> 
> Compiles and runs so far. Compositing works. However, I did not test it very \
> intensively. Please report any inconsistencies. Thx. 
> 
> Thanks,
> 
> Arthur Arlt
> 
> 


[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/102420/">http://git.reviewboard.kde.org/r/102420/</a>
  </td>
    </tr>
   </table>
   <br />









<div>




<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/102420/diff/3/?file=62008#file62008line871" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/activation.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

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

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

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
Client::setActive(bool act)</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">871</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="n">workspace</span><span class="p">()</span><span class="o">-&gt;</span><span \
class="n">compositor</span><span class="p">()</span><span class="o">-&gt;</span><span \
class="n">checkUnredirect</span><span class="p">();</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">make \
compositor() a global function returning Workspace::self()-&gt;compositor()?</pre> \
</div> <br />

<div>




<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/102420/diff/3/?file=62009#file62009line216" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/bridge.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

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

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

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">void \
Bridge::grabXServer(bool grab)</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">216</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span \
class="k">return</span> <span class="n">c</span><span class="o">-&gt;</span><span \
class="n">workspace</span><span class="p">()</span><span class="o">-&gt;</span><span \
class="n">compositor</span><span class="p">()</span><span class="o">-&gt;</span><span \
class="n">compositingActive</span><span class="p">();</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">and is \
compositingActive() actually required with this design (should the presence of the \
compositor not indicate it&#39;s active?) - iff, we&#39;d rather need \
&quot;isDying()&quot; on destruction (for threadsand is compositingActive() actually \
required with this design (should the presence of the compositor not indicate \
it&#39;s active?) - iff, we&#39;d rather need &quot;isDying()&quot; on destruction \
(for threads)

Right now it seems m_compositor is just some heap memory that follows the lifetime of \
workspace, but if it would be deleted on toggling the compositor (and the pointer \
nulled before calling the deconstructor*) this would end up being less cumbersome, \
yesno?

*
Compositor *comp = m_compositor;
m_compositor = NULL;
delete comp;

This way you could also spare the m_finishingCompositing and compositing() \
flags</pre> </div>
<br />

<div>




<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/102420/diff/3/?file=62014#file62014line472" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/events.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

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

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

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
Workspace::workspaceEvent(XEvent * e)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">462</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span \
class="k">if</span> <span class="p">(</span><span class="n">compositing</span><span \
class="p">())</span> <span class="p">{</span></pre></td>  <th bgcolor="#e9eaa8" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">471</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">            <span \
class="k">if</span> <span class="p">(</span><span class="n">compositing</span><span \
class="p">()</span><span class="hl"> </span><span class="o"><span \
class="hl">&amp;&amp;</span></span><span class="hl"> </span><span class="n"><span \
class="hl">m_compositor</span></span><span class="p">)</span> <span \
class="p">{</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">since scene \
is now controlled by the compositor instance, this should be redundant, ie. if \
there&#39;s m_compositor compositing() should implicitly be true (afaics...)</pre> \
</div> <br />

<div>




<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/102420/diff/3/?file=62014#file62014line477" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/events.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

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

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

   <td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">bool \
Workspace::workspaceEvent(XEvent * e)</pre></td>

  </tr>
 </tbody>



 
 




 <tbody>

  <tr>
    <th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">467</font></th>  <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; ">                    <span \
class="n"><span class="hl">c</span>ompositeResetTimer</span><span class="p"><span \
class="hl">.</span></span><span class="n"><span class="hl">start</span></span><span \
class="p">(</span><span class="mi">0</span><span class="p">);</span></pre></td>  <th \
bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid \
#C0C0C0;" align="right"><font size="2">476</font></th>  <td bgcolor="#fdfebc" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">              \
<span class="n"><span class="hl">m_compositor</span></span><span class="o"><span \
class="hl">-&gt;</span></span><span class="n"><span \
class="hl">setC</span>ompositeResetTimer</span><span class="p">(</span><span \
class="mi">0</span><span class="p">);</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">&quot;startCompositeResetTimer&quot; ...</pre> </div>
<br />

<div>




<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/102420/diff/3/?file=62019#file62019line1013" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/workspace.cpp</a>  <span style="font-weight: normal;">

     (Diff revision 3)

    </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 Workspace::slotRestartKwin(const QString&amp; reason)</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">990</font></th>  <td bgcolor="#c5ffc4" \
width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span \
class="kt">void</span> <span class="n">Workspace</span><span class="o">::</span><span \
class="n">slotRestartKwin</span><span class="p">(</span><span class="k">const</span> \
<span class="n">QString</span><span class="o">&amp;</span> <span \
class="n">reason</span><span class="p">)</span></pre></td>  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Why wrap \
this in a slot instead of making it one?</pre> </div>
<br />



<p>- Thomas</p>


<br />
<p>On May 2nd, 2012, 4:19 p.m., Arthur Arlt 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 Arthur Arlt.</div>


<p style="color: grey;"><i>Updated May 2, 2012, 4:19 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;">This patch moves all the Workspace functionality implemented in file \
composite.cpp to its own class Compositor. A new header file composite.h was created \
as well. All function calls were updated. Maybe the shortcut set to the slot \
&#39;slotToggleCompositing&#39; in kwinbinding.cpp could be connected directly to the \
slot in class Compositor. At the moment it is redirected from Workspace.</pre>  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </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;">Compiles and runs so far. Compositing works. However, I did not test it \
very intensively. Please report any inconsistencies. Thx.</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/composite.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>kwin/client.cpp <span style="color: grey">(410ff43)</span></li>

 <li>kwin/activation.cpp <span style="color: grey">(451394f)</span></li>

 <li>kwin/bridge.cpp <span style="color: grey">(897d432)</span></li>

 <li>kwin/composite.cpp <span style="color: grey">(6a27e00)</span></li>

 <li>kwin/effects.cpp <span style="color: grey">(8e73780)</span></li>

 <li>kwin/events.cpp <span style="color: grey">(cb397b2)</span></li>

 <li>kwin/geometry.cpp <span style="color: grey">(92a23e3)</span></li>

 <li>kwin/layers.cpp <span style="color: grey">(ed8555c)</span></li>

 <li>kwin/toplevel.cpp <span style="color: grey">(00bd7dd)</span></li>

 <li>kwin/workspace.h <span style="color: grey">(9df435c)</span></li>

 <li>kwin/workspace.cpp <span style="color: grey">(b5c8014)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/102420/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