<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: possible infinite loop in gdkwindow-wayland"
   href="https://bugzilla.gnome.org/show_bug.cgi?id=759299">759299</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>wayland: possible infinite loop in gdkwindow-wayland
          </td>
        </tr>

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

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

        <tr>
          <th>Version</th>
          <td>3.19.x
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>ofourdan@redhat.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>Created <span class=""><a href="attachment.cgi?id=317111" name="attach_317111" title="Reproducer program">attachment 317111</a> <a href="attachment.cgi?id=317111&action=edit" title="Reproducer program">[details]</a></span>
Reproducer program

Summary:

The Wayland backend will enter an infinite loop in case of a cycle in transient
relationship (a transient for B and B transient for A).

Steps to reproduce:

1. Save and build the attached program
  $ gcc -o cycling-transient cycling-transient.c `pkg-config --libs --cflags
gtk+-3.0`

2. Execute the program under Wayland

Actual result:

The program wil lenter an infinite loop and take 100% CPU

Expected result:

The windows appear normally as in X11

Additional data:

This is because of the following code construct in gdkwindow-wayland.c

      while (window)
        {
          GdkWindowImplWayland *impl;
          impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
          window = impl->transient_for;
        }

As found in find_grab_input_seat(), get_popup_parent() or
gdk_wayland_window_get_fake_root_coords()</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>