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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On September 29th, 2012, 6:48 a.m., <b>David Faure</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;">Doesn't this break "moving a tab with MMB" then? The KTabBar mousePress/mouseRelease code won't be called anymore.

If this is the case, then what we really have is two incompatible features... so we could just remove the "moving with MMB" code in ktabbar and this eventFilter wouldn't be needed.</pre>
 </blockquote>




 <p>On September 29th, 2012, 4:31 p.m., <b>Dawit Alemayehu</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;">Why remove a feature other application might want to have or was the "moving a tab with MMB" specifically added for Konqueror's sake ? Anyhow, this patch does not really break "moving a tab with MMB" unless the user checks the "Middle-click on a tab to close it" option. Otherwise, the MMB click on a tab will continue to behave as it does now.</pre>
 </blockquote>





 <p>On October 9th, 2012, 8:31 a.m., <b>David Faure</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;">You didn't reply as to whether this breaks "moving a tab with MMB". If it does, that's fine with me, given that "moving a tab with LMB" works and is much more intuitive anyway.

My point is the following: this MMB-move in KTabBar is a compatibility feature only. I would like to see it removed in KF5, for more compatibility with QTabBar (possibly so that KTabBar isn't even needed anymore). At that point, the eventFilter in this commit (which is a workaround for that MMB-sends-LMB hack in KTabBar) will just be overkill, the old code would be fine again. Will we remember to revert this commit then? OK here's a solution: please add a #pragma message("KF5: revert the commit that introduced this line") in your patch, inside #ifdef QT_VERSION >= QT_VERSION_CHECK(5, 0, 0), so that we remember doing it. I don't like keeping complicated code for the long run, it only makes maintainance harder.</pre>
 </blockquote>








</blockquote>

<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 thought I did. Let me rephrase it. Moving a tab with MMB works so long as the user does not explicitly check the "Middle-click on a tab to close it" option. If the user enables that option then clicking with the MMB will result in the tab being closed without the side effects that is currently being observed, i.e. the current active tab being changed. So yes, moving with MMB will work fine with this patch.

I understand what you mean. If the issue is fixed in KTabBar or KTabBar no longer becomes necessary, then this fix is unnecessary and as such it should be removed. Hence, I will add the #pragma message as you suggest and push the fix upstream.</pre>
<br />








<p>- Dawit</p>


<br />
<p>On October 8th, 2012, 5:26 p.m., Dawit Alemayehu 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 KDE Base Apps and David Faure.</div>
<div>By Dawit Alemayehu.</div>


<p style="color: grey;"><i>Updated Oct. 8, 2012, 5:26 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;">The attached patch fixes the bug where clicking on a tab with the MMB while the "Middle-click on a tab to close it" option is checked results in the tab gaining the focus first before being closed instead of being closed in the background. That results in the active tab being changed when a user activates the aforementioned option and clicks on a background tab with the MMB. 

For the record the reason why this really happens is KTabBar's treatment of the MMB clicks when the setMovable is set to TRUE. In addition to emitting a mouseMiddleClick signal which Konqueror currently relies on to close the tab, it also eats the MMB click event and generates a new LMB click event in its place. Apparently that was done for compatibility sake so that the user can move tabs using either the LMB or MMB.  

Anyhow, this patch addresses the problem by installing an event filter to intercept the mouse events from the tabbar and handle MMB clicks on its own when the aforementioned option is checked so that we do not receive unnecessary bogus events.</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;">Check/uncheck the "Middle-click on a tab to close it" option and tested the behavior.

- When the option is unchecked, clicking on a background tab with MMB behaves the same way as it currently does.
- When the option is checked, clicking on a background tab with MMB will immediately close it without changing the current active tab.</pre>
  </td>
 </tr>
</table>



<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=264058">264058</a>


</div>


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

 <li>konqueror/src/konqtabs.h <span style="color: grey">(4b6f1f1)</span></li>

 <li>konqueror/src/konqtabs.cpp <span style="color: grey">(611659f)</span></li>

</ul>

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




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








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