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





<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: 10px;">
 <p style="margin-top: 0;">On January 5th, 2013, 3:13 p.m., <b>Fredrik Höglund</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;">Because the XFixesSelectSelectionInput() call specifies that the event should be delivered to winId(). KSelectionOwner does not send XFixes events; they are generated by the X server.
</pre>
 </blockquote>




 <p>On January 5th, 2013, 4:32 p.m., <b>Thomas Lübking</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;">Ok, problem is: whether by compiz, e17, kwin, xcompmgr - the event occurs on the root but not on winId() - even for the simplistic testcase (which also works on QApplication but for the selectionwatcher)

I tried adding some junk into XFixesSelectSelectionInput and get a request error (as expected)

X Error: BadWindow (invalid Window parameter) 3
  Extension:    138 (Uknown extension)
  Minor opcode: 2 (Unknown request)
  Resource id:  0x3039

yet KWindowSystem fires on compositing toggle.

Then i removed XFixesSelectSelectionInput - and still (patched to check against root) KWindowSystem fires on compositing toggle.



Now it gets interesting (I removed the KSelectionWatcher bits for the last tests):
-----------------------------------------------------------------------------------------
If i keep XFixesSelectSelectionInput AND the check against the root window i get after the event on root TWO additional events on the winId()
If i remove either, i get none of them (but still one on the root which however is ignored)

So ulitmately i just ate away (return true) selectionnotify events on the root window and in return got ONE additional event on the winId which then fired the signal - what is all less then ideal, since (just as the present patch btw.) we also eat away "regular" selectionowner events.</pre>
 </blockquote>





 <p>On January 5th, 2013, 5:49 p.m., <b>Fredrik Höglund</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;">This happens because Qt compresses XFixesSelectionNotifyEvents by deleting all events in the queue that refer to same selection except the last one. It does this without taking the destination window or the subtype into account, so it will randomly swallow either its own event or the event selected by KWindowSystem. The event you see delivered to the root window is the event selected by Qt for QX11Info::isCompositingManagerRunning().
</pre>
 </blockquote>





 <p>On January 5th, 2013, 7:57 p.m., <b>Thomas Lübking</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;">Ok, i can see the bug in qt_xfixes_scanner.

-> Question is, whether we should - given the Qt4 lifecycle - just work around that for KDE4 by either relying on the Qt selection and just scanning for the root or not relying on the Qt selection and pass on root events while swallow winId() ones but hook on both to re-evaluate the compositing state.

Is there any remote chance there'll be another Qt4 minor release?</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;">> Is there any remote chance there'll be another Qt4 minor release?
Ok, at least there's quite some action on the git tree and the term 4.8.5 ;-)</pre>
<br />








<p>- Thomas</p>


<br />
<p>On January 5th, 2013, 5:08 p.m., Thomas Lübking 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 kdelibs, kwin, Plasma, Aaron J. Seigo, Marco Martin, Martin Gräßlin, and Fredrik Höglund.</div>
<div>By Thomas Lübking.</div>


<p style="color: grey;"><i>Updated Jan. 5, 2013, 5:08 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;">It works fine here (tested so far KWindowSystem signal, KSelectionWatcher only with kwin) with kwin (shift+alt+f12), xcompmgr, compiz & "metacity -c" and e17.
Didn't try xfce nor mutter.

Technically:
I do not at all understand why KWindowSystem is *not* watching the root window - KSelectionOwner for one is sending events to the root and this also seems the case for all other WMs (at least everything now starts to cause the signal to be emitted)

The KSelectionWatcher failure seems to be kwin specific (wrote me a cleaner testcase), there'll be some X11 event processing on top that eats away the client messages.
So this one can be scratched from the patch, the KWindowSystem issue remains.</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;">see summary</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=179042">179042</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>kdeui/windowmanagement/kwindowsystem_x11.cpp <span style="color: grey">(f9b3cc1)</span></li>

</ul>

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




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








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