[PATCH wayland] tests/resources-test: Fix wl_resource_post_event call

Jason Ekstrand jason at jlekstrand.net
Mon Jan 6 14:12:57 PST 2014


On Mon, Jan 6, 2014 at 8:34 AM, Mariusz Ceier <mceier+wayland at gmail.com>wrote:

> I think both patches (and original code too obviously) are wrong -
> WL_DISPLAY_ERROR (opcode 0) event has signature "ous", so Quentin
> patch calls event with too many arguments and ignores types, and Marek
> patch calls event with too few arguments and incorrect type for the
> second argument.
> Imo, correct invocation should be either:
>   wl_resource_post_event(res, WL_DISPLAY_ERROR, res,
> WL_DISPLAY_ERROR_INVALID_OBJECT,"This error will be ignored");
> or
>   wl_resource_post_event(res, WL_DISPLAY_ERROR, NULL,
> WL_DISPLAY_ERROR_INVALID_OBJECT,"This error will be ignored");
> am I right ?
>

Actually... The test is simply wrong.  The comment above it says that it
expects that event to be ignored since there is no implementation.
However, this is backwards.  The implementation has nothing to do with
events, it is a bunch of request handlers.  The wl_resource_post_event
should still post an event and send it along the network even if there is
no "implementation".  There are some places where we do this in weston, in
fact.  For instance, it used to be that wl_touch and wl_keyboard had no
requests (this has since changed) and, at the time, I think we handed in a
null implementation.  (This has changed in version 3 of wl_seat and they
now have "release" requests and handlers.)

I'm sorry that I didn't look at this any earlier.
Thanks,
--Jason Ekstrand
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140106/50d83982/attachment.html>


More information about the wayland-devel mailing list