On Mon, Jul 8, 2013 at 6:10 AM, Rob Bradford <[email protected]>wrote:
> *bump* > > This is a fix for: > https://bugs.freedesktop.org/show_bug.cgi?id=65726&list_id=320167 > > Although it might be much better if we could emit the event > (especially the leave) before we destroy the surface - that being said > the destruction of the object will also result in the proxy being > removed from the map and so when the event is received the callback > will still have a NULL pointer. > That's exactly what weston *was* doing. However, thanks to the destroyed proxies, the clients were getting NULL anyway. We could to go through a bunch of trouble to keep the resource valid and call wl_pointer.leave on a valid resource. However, that's a lot more work than I thought it was worth for no change client-side. The other option here is to specify that the client does not get the leave event if the surface is destroyed. In either case, it needs to be specified. --Jason > > Rob > > On 17 June 2013 23:56, Jason Ekstrand <[email protected]> wrote: > > The current specified behavior does not allow a null surface in either of > > these events. However, if the client calls wl_surface.destroy while the > > surface has focus then the leave handler will get a null surface anyway > > because the proxy corresponding to the wl_surface no longer exists. This > > change makes this edge-case explicit and allows the server to avoid > sending > > an event with an argument it knows the client has destroyed. > > > > Signed-off-by: Jason Ekstrand <[email protected]> > > --- > > protocol/wayland.xml | 10 ++++++---- > > 1 file changed, 6 insertions(+), 4 deletions(-) > > > > diff --git a/protocol/wayland.xml b/protocol/wayland.xml > > index 3d4ec9b..faa284e 100644 > > --- a/protocol/wayland.xml > > +++ b/protocol/wayland.xml > > @@ -1313,13 +1313,14 @@ > > <event name="leave"> > > <description summary="leave event"> > > Notification that this seat's pointer is no longer focused on > > - a certain surface. > > + a certain surface. The surface parameter may be null if the > > + surface has been destroyed. > > > > The leave notification is sent before the enter notification > > for the new focus. > > </description> > > <arg name="serial" type="uint"/> > > - <arg name="surface" type="object" interface="wl_surface"/> > > + <arg name="surface" type="object" interface="wl_surface" > allow-null="true"/> > > </event> > > > > <event name="motion"> > > @@ -1430,13 +1431,14 @@ > > <event name="leave"> > > <description summary="leave event"> > > Notification that this seat's keyboard focus is no longer on > > - a certain surface. > > + a certain surface. The surface parameter may be null if the > > + surface has been destroyed. > > > > The leave notification is sent before the enter notification > > for the new focus. > > </description> > > <arg name="serial" type="uint"/> > > - <arg name="surface" type="object" interface="wl_surface"/> > > + <arg name="surface" type="object" interface="wl_surface" > allow-null="true"/> > > </event> > > > > <enum name="key_state"> > > -- > > 1.8.1.4 > > > > _______________________________________________ > > wayland-devel mailing list > > [email protected] > > http://lists.freedesktop.org/mailman/listinfo/wayland-devel > _______________________________________________ > wayland-devel mailing list > [email protected] > http://lists.freedesktop.org/mailman/listinfo/wayland-devel >
_______________________________________________ wayland-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/wayland-devel
