Re: Proposal: use of xdg-shell popups outside of xdg-shell
On Tue, Mar 13, 2018 at 09:29:30AM -0400, Drew DeVault wrote: > Hi there! Over at the wlroots project we're thinking about repurposing > xdg-shell popups for use in another protocol that needs popups. The > popup interface is somewhat complex and duplicating it for each protocol > that might want to support popups is less than ideal. > > From an API perspective, both xdg positioner and xdg popup look easily > reused with parents other than xdg toplevel. Everything is cleanly > separated in xdg shell to accomodate for this. The only real issue is > this line: > > https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml#L1010 > > I propose simply dropping this comment from the protocol description. > It's a backwards- and forwards-compatible change, and there's no > compelling API-driven reason not to permit the reuse of xdg popups > elsewhere. Would definitely simplify the implementation of our new > protocol and future protocols that could use them. Sounds good to me. FWIW, https://cgit.freedesktop.org/wayland/wayland-protocols/commit/?id=a3cf97ff982638bf7ed23b4303eba280c521b54d had this possibility in mind, but seems I missed the part you pointed out. Jonas > > -- > Drew DeVault ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Proposal: use of xdg-shell popups outside of xdg-shell
On Wed, 14 Mar 2018 09:13:48 -0400 Drew DeVaultwrote: > >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) > > > > 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. > > > 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 pgphDNN_F_RW8.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Re: Proposal: use of xdg-shell popups outside of xdg-shell
On Tue, 13 Mar 2018 09:29:30 -0400 Drew DeVaultwrote: > Hi there! Over at the wlroots project we're thinking about repurposing > xdg-shell popups for use in another protocol that needs popups. The > popup interface is somewhat complex and duplicating it for each protocol > that might want to support popups is less than ideal. > > From an API perspective, both xdg positioner and xdg popup look easily > reused with parents other than xdg toplevel. Everything is cleanly > separated in xdg shell to accomodate for this. The only real issue is > this line: > > https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml#L1010 > > I propose simply dropping this comment from the protocol description. > It's a backwards- and forwards-compatible change, and there's no > compelling API-driven reason not to permit the reuse of xdg popups > elsewhere. Would definitely simplify the implementation of our new > protocol and future protocols that could use them. Hi, 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. Thanks, pq pgplnhvPTox55.pgp Description: OpenPGP digital signature ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel
Proposal: use of xdg-shell popups outside of xdg-shell
Hi there! Over at the wlroots project we're thinking about repurposing xdg-shell popups for use in another protocol that needs popups. The popup interface is somewhat complex and duplicating it for each protocol that might want to support popups is less than ideal. From an API perspective, both xdg positioner and xdg popup look easily reused with parents other than xdg toplevel. Everything is cleanly separated in xdg shell to accomodate for this. The only real issue is this line: https://github.com/wayland-project/wayland-protocols/blob/master/stable/xdg-shell/xdg-shell.xml#L1010 I propose simply dropping this comment from the protocol description. It's a backwards- and forwards-compatible change, and there's no compelling API-driven reason not to permit the reuse of xdg popups elsewhere. Would definitely simplify the implementation of our new protocol and future protocols that could use them. -- Drew DeVault ___ wayland-devel mailing list wayland-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/wayland-devel