[PATCH weston 03/17] xdg-shell: Document error conditions when popup and surface getters

Jasper St. Pierre jstpierre at mecheye.net
Thu Apr 30 09:25:05 PDT 2015


Oh, nice catch, that's a typo. The expected behavior here is that you
cannot change from xdg_surface to xdg_popup or cursor surface or
anything.

You should be able to destroy and recreate the xdg_surface without
destroying the wl_surface.

On Thu, Apr 30, 2015 at 7:08 AM, Giulio Camuffo <giuliocamuffo at gmail.com> wrote:
> 2015-04-07 12:01 GMT+03:00 Jonas Ådahl <jadahl at gmail.com>:
>> Document that a wl_surface can only be assigned either a xdg_popup or
>> xdg_surface once and that if the client still stries to do that an error
>> is raised.
>>
>> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
>> ---
>>  protocol/xdg-shell.xml | 14 ++++++++++++--
>>  1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml
>> index 09ce019..9dbf193 100644
>> --- a/protocol/xdg-shell.xml
>> +++ b/protocol/xdg-shell.xml
>> @@ -79,7 +79,12 @@
>>      <request name="get_xdg_surface">
>>        <description summary="create a shell surface from a surface">
>>         This creates an xdg_surface for the given surface and gives it the
>> -       xdg_surface role. See the documentation of xdg_surface for more details.
>> +       xdg_surface role. A wl_surface can only be given an xdg_surface role
>> +       once. If get_xdg_surface is called with a wl_surface that was previously
>> +       an xdg_surface or if it had any other role, an error is raised.
>
> This surprises me a bit. My understanding was that the consensus about
> surface roles is that you cannot change them but you can destroy and
> request again the same role. I don't see what is the reason to
> disallow that, and on the other hand, with the qtwayland hat on, that
> would be annoying when hiding/showing windows.
>
>
> Thanks,
> Giulio
>
>> +
>> +       See the documentation of xdg_surface for more details about what an
>> +       xdg_surface is and how it is used.
>>        </description>
>>        <arg name="id" type="new_id" interface="xdg_surface"/>
>>        <arg name="surface" type="object" interface="wl_surface"/>
>> @@ -88,10 +93,15 @@
>>      <request name="get_xdg_popup">
>>        <description summary="create a popup for a surface">
>>         This creates an xdg_popup for the given surface and gives it the
>> -       xdg_popup role. See the documentation of xdg_popup for more details.
>> +       xdg_popup role. A wl_surface can only be given an xdg_popup role
>> +       once. If get_xdg_popup is called with a wl_surface that was previously
>> +       an xdg_popup or if it had any other role, an error is raised.
>>
>>         This request must be used in response to some sort of user action
>>         like a button press, key press, or touch down event.
>> +
>> +       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="surface" type="object" interface="wl_surface"/>
>> --
>> 2.1.4
>>
>> _______________________________________________
>> wayland-devel mailing list
>> wayland-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> _______________________________________________
> 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