<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 2, 2016 at 10:42 PM, <span dir="ltr"><<a href="mailto:spitzak@gmail.com" target="_blank">spitzak@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">From: Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>><br>
<br>
Scanner produces a xyz_create() for each object that wraps the<br>
wl_proxy_create function. For each constructor request a new "Ex" version<br>
is created that takes the created object. This allows the queue to be set<br>
before creation. The existing code using proxy_wrapper changed to use this.<br>
<br>
Comments/questions:<br>
<br>
wl_registry_bindEx is nyi and is needed</blockquote><div><br></div><div>The comment (the proxy_wrapper does not fix this either) is for the events and was added to the wrong paragraph:</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
You cannot use create for an object provided by an event, and I see no good<br>
way to achieve this. Not very important unless static wl_proxy is supported.<br></blockquote><div> (the proxy_wrapper does not fix this either)</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
It may be better for the create function to take an actual factory proxy pointer,<br>
rather than a wl_proxy*, to avoid casts. <br></blockquote><div><br></div><div>I now think trying to reuse wl_proxy_create is a mistake. That function is not being used by any other Wayland code and I guess is legacy. Instead data from the factory object can be copied when the request is made, so no factory has to be passed to create (which would not call wl_proxy_create and would not need the lock). The example using the wl_callback would then look like this:</div><div><br></div><div> callback = wl_callback_create(); /* sets interface and refcount */</div><div> wl_proxy_set_queue((struct wl_proxy *) callback, queue); /* sets queue */</div><div> wl_callback_add_listener(callback, &sync_listener, &done); /* sets dispatcher */</div><div> wl_display_syncEx(display, callback); /* sets display, version, id */</div><div><br></div><div>If set_queue was not called it could also copy the queue from the factory object, but I'm not sure if that is necessary.</div><div><br></div></div></div></div>