[PATCH wayland-protocols v2] xdg-shell: Introduce xdg_tooltip
Jasper St. Pierre
jstpierre at mecheye.net
Wed Feb 3 19:36:48 UTC 2016
set_parent was moved to xdg_toplevel. Perhaps that's a good idea,
perhaps it's not. This does mean that a tooltip's parent can never
change, and a popup's parent can never change. That can help for
getting grab semantics right, though it might be an idea if we say
that set_parent on a popup / tooltip simply emit error if a parent is
already set. I'm -1 to that, though.
Some think that wl_surface.attach's coordinates are confusing and
built poorly, and I am inclined to agree, however, when I wrote the
original get_xdg_popup, I simply forgot about them. It might be that
we do positioning on first-attach, and we say that the tooltip is
defined to be 0,0 relative to the surface. That is an idea, though I'm
+0 on it.
On Wed, Feb 3, 2016 at 11:08 AM, Bill Spitzak <spitzak at gmail.com> wrote:
> On Wed, Feb 3, 2016 at 1:06 AM, Jasper St. Pierre <jstpierre at mecheye.net>
>> The existing surface. Perhaps this "get_" naming is a bit confusing,
>> and should be renamed to "create_tooltip" or "make_tooltip" or
>> similar. The intended client flow is:
>> toplevel_wl_surface = wl_compositor.create_surface()
>> toplevel_xdg_surface = xdg_shell.get_xdg_surface(toplevel_wl_surface)
>> toplevel_xdg_toplevel = toplevel_xdg_surface.get_toplevel()
>> tooltip_wl_surface = wl_compositor.create_surface()
>> tooltip_xdg_surface = xdg_shell.get_xdg_surface(tooltip_wl_surface)
>> tooltip_xdg_tooltip =
>> tooltip_xdg_surface.get_tooltip(toplevel_xdg_toplevel, 150, 150)
>> Attach main buffers to toplevel_wl_surface and tooltip buffers to
>> tooltip_wl_surface. tooltip_xdg_tooltip is a tooltip surface attached
>> to the toplevel.
> But I thought there already was an api to set the parent of a xdg_surface!
> I do not think there should be redundancy in ways to get things done, it
> makes it painful for toolkit implementations. It looks to me that if a
> toolkit makes a tooltip the same class structure as a normal window, and the
> user calls the generic setParent on that class, the tooltip is going to have
> to lookup the setParent result just so it can pass it *again* in the
> get_tooltip request. Or I suppose you could use null to mean "leave the
> parent as-is".
> There already is relative positioning for child surfaces, that should be
> reused as well, rather than passing the xy here. In fact there is quite a
> lot of api for figuring out relative positioning and it is silly that this
> request makes all that useless by overwriting it. Again if you insist I
> guess you can use 0,0 as an indication of "leave it as-is".
More information about the wayland-devel