Thinking about popup windows
Kristian Hoegsberg
hoegsberg at gmail.com
Wed Feb 29 13:06:16 PST 2012
On Wed, Feb 29, 2012 at 07:14:11PM +0000, Rob Bradford wrote:
>
> This and the patches for weston are an attempt at how a client could
> communicate with the compositor about positioning surfaces. The
> slightly weird thing is that you make this request not against the
> surface you are going to position but against its parent.
We could do something like how we use wl_callback for wl_display.sync,
which is the closest thing we have to a request/reply pair. We create
a transient object and pass it in the request, the compositor receives
it, sends an event to the object, and destroys it. See display_sync()
in wayland-server.c. So maybe something like:
<request name="probe_area">
<arg name="x" type="int"/>
<arg name="y" type="int"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
<arg name="result" type="new_id" interface="wl_probe_result"/>
</request>
...
<interface name="wl_probe_result">
<event name="visible_area">
<arg name="x" type="int"/>
<arg name="y" type="int"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
</event>
</interface>
And then you can say
result = wl_shell_surface_probe_area(shsurf, x, y, width, height);
wl_probe_result_add_listener(result, ...);
> This makes the implementation in the client side a little bit weird since you
> have to store the surface that you are going to do the work on - perhaps we
> should adjust the protocol so you pass the parent into the request and make
> the request on the surface you are going to position.
Yeah, I guess with the above interface, you still have to have the
parent around when you do the probe and later on too if you want to do
multiple probes. But at least the callback doesn't come on a
different surface.
Kristian
>
> Cheers,
>
> Rob
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list