<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Invalid user data pointer passed to "pointer_handle_enter""
   href="https://bugs.freedesktop.org/show_bug.cgi?id=73711#c9">Comment # 9</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Invalid user data pointer passed to "pointer_handle_enter""
   href="https://bugs.freedesktop.org/show_bug.cgi?id=73711">bug 73711</a>
              from <span class="vcard"><a class="email" href="mailto:conselvan2@gmail.com" title="Ander Conselvan de Oliveira <conselvan2@gmail.com>"> <span class="fn">Ander Conselvan de Oliveira</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=73711#c8">comment #8</a>)
<span class="quote">> Thanks, the trace confirms. You never set an empty input region, so it
> defaults to the whole surface. However, the mistake is not yours.

> The protocol specification for wl_pointer.set_cursor says: "The current and
> pending input regions of the wl_surface are cleared, and
> wl_surface.set_input_region is ignored until the wl_surface is no longer
> used as the cursor."

> Therefore this is indeed a Weston bug: it should never pick the cursor
> surface into focus.</span >

Indeed the problem is in Weston. The input region of the cursor surface is set
to empty in pointer_cursor_surface_configure(). Since during the commit process
this function is called before the pending input region is made current, it
empties surface->pending.input instead of the pending input region instead of
surface->input.

But pointer_cursor_surface_configure() is also called from pointer_set_cursor()
in order to map the cursor even if there isn't a subsequent attach and commit
to the cursor surface. In that case, surface->input is never emptied, since the
configure function emptied only the pending input region and there wasn't a
commit that made it effective.

Here's the sequence of requests that triggers the problem. 

[3269633.625]  -> <a href="mailto:wl_compositor@3.create_surface">wl_compositor@3.create_surface</a>(new id wl_surface@11)
[3269633.685]  -> <a href="mailto:wl_surface@11.attach">wl_surface@11.attach</a>(wl_buffer@12, 0, 0)
[3269633.704]  -> <a href="mailto:wl_surface@11.damage">wl_surface@11.damage</a>(0, 0, 24, 24)
[3269633.730]  -> <a href="mailto:wl_surface@11.commit">wl_surface@11.commit</a>()
[3269633.739]  -> <a href="mailto:wl_pointer@9.set_cursor">wl_pointer@9.set_cursor</a>(0, wl_surface@11, 5, 0)</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>