<html>
    <head>
      <base href="https://bugzilla.gnome.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - wayland: Don't broadcast selection owner changes"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=754158">754158</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wayland: Don't broadcast selection owner changes
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Platform
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>gtk+
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>Normal
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: Wayland
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jadahl@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>gtk-bugs@gtk.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>rob@robster.org.uk, wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>GNOME version</th>
          <td>---
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I discovered this while debugging something looking like a memory leak in GNOME
Terminal. What seemed to be leaking was GDK_SELECTION_NOTIFY events created in
gdkselection-wayland.c but I have yet to find out why they actually leaked, or
if something other funky was going on. What I discovered though is that O(n^2)
"GDK_OWNER_CHANGE" events were emitted for n open terminal windows, which
seemed odd. This patch fixes that case by not broadcasting the change, but only
sending it once per time it happens.

I'm not sure whether this actually fixes the issues I have been seeing (I have
logs where ~59000 GDK_SELECTION_NOTIFY events are queued up but only ~27000
being emitted before more are being queued which is extremely odd by itself).
The extreme GDK_SELECTION_NOTIFY queueing I've been seeing is very hard to
reproduce, and happens once or less per day of quite heavy use. I have no idea
if this patch affects this since but I guess I will find out in due time.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>