<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="12" style="border: 1px #c9c399 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://git.reviewboard.kde.org/r/129204/">https://git.reviewboard.kde.org/r/129204/</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="https://git.reviewboard.kde.org/r/129204/diff/1/?file=482310#file482310line151" style="color: black; font-weight: bold; text-decoration: underline;">src/scriptengines/qml/plasmoid/appletinterface.cpp</a>
    <span style="font-weight: normal;">

     (Diff revision 1)

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



 
 

 <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">151</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="kt">bool</span> <span class="n">activate</span> <span class="o">=</span> <span class="o">!</span><span class="n">isExpanded</span><span class="p">();</span></pre></td>
  </tr>

 </tbody>

</table>

 <div style="margin-left: 2em;">

  <pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"><p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Because AppletInterface::activated is a signal, applets could connect to to do extra actions on external activation; we're not emitting that with this signal.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">and this isn't just hypothetical as kicker does.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">kicker/package/contents/ui/CompactRepresentation.qml: <br style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;" />
plasmoid.activated.connect(function()</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">(ironically to do toggling on the dash window)</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">By introducing a new signal, this breaks existing applets.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">We could maybe simply add 
if (activate) emit activated();</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">and it'd work.</p>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Question:
the current global shortcuts seem to toggle, and they only connect to activate(), how do they work?</p></pre>
 </div>
</div>
<br />



<p>- David Edmundson</p>


<br />
<p>On October 17th, 2016, 7:02 a.m. UTC, Roman Gilg wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="12" style="border: 1px #888a85 solid; border-radius: 6px; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
 <tr>
  <td>

<div>Review request for Plasma and Martin Gräßlin.</div>
<div>By Roman Gilg.</div>


<p style="color: grey;"><i>Updated Oct. 17, 2016, 7:02 a.m.</i></p>







<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>


 <a href="http://bugs.kde.org/show_bug.cgi?id=367685">367685</a>


</div>



<div style="margin-top: 1.5em;">
 <b style="color: #575012; font-size: 10pt;">Repository: </b>
plasma-framework
</div>


<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;"><h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">The new Meta-key support for launcher opening doesn't work for closing at the moment. My analysis of the problem was as follows:</h1>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">KWin calls Applet::activated() over DBus</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Applet::activated() is connected to AppletInterface::activated()</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">AppletInterface::activated() is connected to setExpanded(true), which can only expand the launcher, but not the other way around</li>
</ul>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Q: Why is Alt+F1 working though?</h1>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A: The launchers seem to inherit the reimplemented function Dialog::focusOutEvent(..). Atleast when you delete line 1094 in dialog.cpp, which sets the visibility to false, it's not working anymore. Alt+F1 triggers the focusOutEvent(..) as a global shortcut.</p>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Q: Why is it working with the Dashboard though?</h1>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">A: The dashboard doesn't use the expanded feature of the plasmoid, but rather connects directly to the AppletInterface::activated() signal and shows/hides an independent widget when this signal gets triggered.</p>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Solution:</h1>
<p style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: inherit;">Create new toggled() signal chain in KWin, Applet, AppletInterface, which tests the current expanded state and sets it afterwards accordingly to the opposite. This diff here in plasma-framework is the first one, which the others depend on. The others are on Phabricator:</p>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">kwin: https://phabricator.kde.org/D3077</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">plasma-workspace: https://phabricator.kde.org/D3078</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">plasma-desktop: https://phabricator.kde.org/D3079</li>
</ul>
<h1 style="font-size: 100%;text-rendering: inherit;padding: 0;white-space: normal;margin: 0;line-height: inherit;">Need feedback regarding:</h1>
<ul style="padding: 0;text-rendering: inherit;margin: 0 0 0 1em;line-height: inherit;white-space: normal;">
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Should we remove the activated() signal chain? Is it used somewhere else than KWin?</li>
<li style="padding: 0;text-rendering: inherit;margin: 0;line-height: inherit;white-space: normal;">Could a race condition occur if we deexpand the applet while at the same time setting the visibility to false through focusOutEvent()? My tests until now don't suggest it, but I haven't yet looked into it extensively.</li>
</ul></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>src/plasma/applet.h <span style="color: grey">(89498ea)</span></li>

 <li>src/scriptengines/qml/plasmoid/appletinterface.h <span style="color: grey">(a1e2cd7)</span></li>

 <li>src/scriptengines/qml/plasmoid/appletinterface.cpp <span style="color: grey">(1cd6934)</span></li>

</ul>

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






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







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