[PATCH wayland-protocols v2] xdg-shell: Introduce xdg_tooltip

Jasper St. Pierre jstpierre at mecheye.net
Wed Feb 3 09:06:54 UTC 2016


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.

On Wed, Feb 3, 2016 at 1:02 AM, Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> 2016-02-03 11:00 GMT+02:00 Jasper St. Pierre <jstpierre at mecheye.net>:
>> No? The parent is the surface the tooltip is laid on top of.
>
> So where do the contents of the tooltip come from?
>
>>
>> On Wed, Feb 3, 2016 at 12:59 AM, Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
>>> 2016-02-03 10:39 GMT+02:00 Jonas Ådahl <jadahl at gmail.com>:
>>>> An xdg_tooltip is a new window type used to implement tooltip like
>>>> surfaces. See the interface documentation for details.
>>>>
>>>> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
>>>> ---
>>>>
>>>> Changes since v1:
>>>>
>>>> Various wording changes as suggested by Mike.
>>>>
>>>> Added missing version attribute and <description/>.
>>>>
>>>>
>>>>  unstable/xdg-shell/xdg-shell-unstable-v6.xml | 41 ++++++++++++++++++++++++++++
>>>>  1 file changed, 41 insertions(+)
>>>>
>>>> diff --git a/unstable/xdg-shell/xdg-shell-unstable-v6.xml b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>>>> index f2eba64..a164bd6 100644
>>>> --- a/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>>>> +++ b/unstable/xdg-shell/xdg-shell-unstable-v6.xml
>>>> @@ -168,6 +168,20 @@
>>>>        <arg name="y" type="int"/>
>>>>      </request>
>>>>
>>>> +    <request name="get_tooltip">
>>>> +      <description summary="assign the xdg_tooltip surface role">
>>>> +       This creates an xdg_tooltip for the given xdg_surface and gives the
>>>> +       associated wl_surface the xdg_tooltip role.
>>>> +
>>>> +       See the documentation of xdg_tooltip for more details about what an
>>>> +       xdg_tooltip is and how it is used.
>>>> +      </description>
>>>> +      <arg name="id" type="new_id" interface="zxdg_tooltip_v6"/>
>>>> +      <arg name="parent" type="object" interface="zxdg_surface_v6"/>
>>>> +      <arg name="x" type="int"/>
>>>> +      <arg name="y" type="int"/>
>>>> +    </request>
>>>
>>> Hi, I have just a comment here:
>>>
>>> I understand that 'parent' here is the actual tooltip surface, right?
>>> The description of the zxdg_tooltip_v6 interface below uses parent to
>>> refer to another surface, and that's i suppose the surface set with
>>> xdg_surface.set_parent(), right? I find that confusing, i would rename
>>> 'parent' in get_tooltip to 'surface', and maybe clarify in the
>>> description what is the actual parent.
>>>
>>>
>>> Cheers,
>>> Giulio
>>>
>>>
>>>> +
>>>>      <request name="set_window_geometry">
>>>>        <description summary="set the new window geometry">
>>>>         The window geometry of a surface is its "visible bounds" from the
>>>> @@ -650,4 +664,31 @@
>>>>
>>>>    </interface>
>>>>
>>>> +  <interface name="zxdg_tooltip_v6" version="1">
>>>> +    <description summary="tooltip surface">
>>>> +      This interface defines an xdg_tooltip role that provides functionality
>>>> +      related to tooltip like surfaces.
>>>> +
>>>> +      An xdg_tooltip is a temporary surface which is displayed over its parent
>>>> +      xdg_surface. The last-created xdg_tooltip surface will always be the
>>>> +      top-most child of the parent xdg_surface.
>>>> +
>>>> +      The parent surface must either have the surface role xdg_toplevel,
>>>> +      xdg_popup or xdg_tooltip.
>>>> +
>>>> +      An xdg_tooltip does not take an active grab while mapped. xdg_tooltip
>>>> +      surfaces are either directly unmapped by clients using the
>>>> +      xdg_tooltip.destroy request or indirectly unmapped when their parent
>>>> +      surface is unmapped.
>>>> +
>>>> +      An xdg_tooltip obeys normal input region semantics.
>>>> +    </description>
>>>> +
>>>> +    <request name="destroy" type="destructor">
>>>> +      <description summary="destroy the xdg_tooltip object">
>>>> +       Unmap the tooltip surface and destroy the object.
>>>> +      </description>
>>>> +    </request>
>>>> +  </interface>
>>>> +
>>>>  </protocol>
>>>> --
>>>> 2.4.3
>>>>
>>>> _______________________________________________
>>>> wayland-devel mailing list
>>>> wayland-devel at lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>>
>>
>>
>> --
>>   Jasper



-- 
  Jasper


More information about the wayland-devel mailing list