xdg-shell/popup: Allow custom parent by passing null as parent

Allow using some other protocol (custom, or future xdg_* based) to set
up the parent-child relationship of a popup. This allows future
protocols to use xdg_popup when mapping popups over surfaces not based
on xdg_surface.

An example use case for this is the window menu, where a shells UI
client can use xdg_popup to create popup menus over windows it does not
have a xdg_surface of by having a custom protocol setting up the proper
parent-child relationship.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-By: Mike Blumenkrantz <zmike@osg.samsung.com>
This commit is contained in:
Jonas Ådahl 2017-05-10 13:50:10 +08:00
parent bb632281d0
commit a3cf97ff98

View file

@ -424,14 +424,17 @@
<request name="get_popup">
<description summary="assign the xdg_popup surface role">
This creates an xdg_popup object for the given xdg_surface and gives the
associated wl_surface the xdg_popup role.
This creates an xdg_popup object for the given xdg_surface and gives
the associated wl_surface the xdg_popup role.
If null is passed as a parent, a parent surface must be specified using
some other protocol, before committing the initial state.
See the documentation of xdg_popup for more details about what an
xdg_popup is and how it is used.
</description>
<arg name="id" type="new_id" interface="xdg_popup"/>
<arg name="parent" type="object" interface="xdg_surface"/>
<arg name="parent" type="object" interface="xdg_surface" allow-null="true"/>
<arg name="positioner" type="object" interface="xdg_positioner"/>
</request>