<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - xwayland-wm: crash in weston_wm_window_handle_moveresize"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=80837">80837</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>wayland-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>xwayland-wm: crash in weston_wm_window_handle_moveresize
          </td>
        </tr>

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

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>stu_dby@126.com
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

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

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

        <tr>
          <th>Component</th>
          <td>weston
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Wayland
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following action will crash weston:
1. launch gnome-terminal under xwayland in weston
2. click on the right side of the menubar (right of "Help" menu)
weston will immediately crash when mouse button is released.

The reason is Xwayland will somehow send a client message type of moveresize
when pointer is released, and weston_wm_window_handle_moveresize will call
weston_wm_pick_seat_for_window, which will always turn NULL if there is no
button pressed. Then weston_wm_pick_seat_for_window will immediately
dereference the NULL pointer.

There are two possible ways if we want to solve the problem on weston side:
1. remove the seat->pointer->button_count > 0 condition in
weston_wm_pick_pointer_for_window to let it return a possible seat
2. check in weston_wm_window_handle_moveresize whether the returned seat is
NULL.

Which is the more appropriate approach?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>