Proposal: use of xdg-shell popups outside of xdg-shell
Pekka Paalanen
ppaalanen at gmail.com
Wed Mar 14 13:27:06 UTC 2018
On Wed, 14 Mar 2018 09:13:48 -0400
Drew DeVault <ddevault at vistarmedia.com> wrote:
> >just checking, how did you design your own protocol extension to take
> >advantage of xdg_popup? I mean, mechanically, what does the protocol
> >request sequence look like when you create an xdp_popup for your own
> >purpose?
> >
> >I'm asking because there is a pretty subtle and horrible catch if it's
> >done "wrong". Having your own protocol extension include a request that
> >creates a protocol object of type xdg_popup is the wrong way. There are
> >other ways to do it without accidentally freezing the xdp_popup
> >interface for all eternity.
>
> Yeah, thankfully this is not how we do it. We do something like this:
>
> 1. xdg_surface = xdg_shell.get_xdg_surface(surface=wl_surface)
> 2. xdg_positioner = xdg_shell.get_positioner()
> 3. xdg_popup = surface.get_popup(parent=NULL, positioner=xdg_positioner)
> 4. layer_surface.assign_popup(popup=xdg_popup)
>
> <request name="assign_popup">
> <description summary="assign this layer_surface as an xdg_popup parent">
> This assigns an xdg_popup's parent to this layer_surface. This popup
> should have been created via xdg_surface::get_popup with the parent set
> to NULL, and this request must be invoked before committing the popup's
> 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="popup" type="object" interface="xdg_popup"/>
> </request>
Alright, cool. Carry on! :-)
So that's how Weston's panel and background could regain their popup
menus as well, good to know.
Thanks,
pq
> Discussion on the specific protocol we're working on is here:
>
> https://github.com/swaywm/wlr-protocols/pull/7
>
> --
> Drew DeVault
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180314/e66873c5/attachment.sig>
More information about the wayland-devel
mailing list