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

Jonas Ådahl jadahl at gmail.com
Wed Feb 3 09:07:45 UTC 2016


On Wed, Feb 03, 2016 at 11:02:14AM +0200, Giulio Camuffo 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?

The tooltip is created from an xdg_surface. As of patch 1/3 of the
series this patch replies to, each "role" (xdg_toplevel, xdg_popup and
xdg_tooltip) is created from a xdg_surface object which contains the
common functionality needed by all xdg_surface based roles.

So its:

Create a xdg_surface A from a wl_surface 1.
Create a xdg_toplevel from a xdg_surface A.

Create a xdg_surface B from a wl_surface 2.
Create a xdg_tooltip from a xdg_surface B passing the xdg_surface A as
the parent.

The tooltip is backed by wl_surface 2, the toplevel is backed by
wl_surface 1.

Jonas

> 
> >
> > 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


More information about the wayland-devel mailing list