<div dir="ltr">Sure, I'll remove it then. (I was going to remove it originally - but figured, it was useful for testing since it exposed this bug.)</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 8, 2015 at 7:00 AM, Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Mon, 6 Apr 2015 13:27:23 -0700<br>
Dima Ryazanov <<a href="mailto:dima@gmail.com">dima@gmail.com</a>> wrote:<br>
<br>
> Yeah, the logic is pretty sketchy now - "if it's a shell surface, do the<br>
> error checking; otherwise, do nothing" - but I don't understand the code<br>
> well enough to know if this is the expected behavior.<br>
><br>
> Should the panel just be a shell surface? Then we could require that the<br>
> popup's parent is a shell surface and simplify the error check.<br>
<br>
</span>No, that won't work. "panel" is a special surface role, it cannot also<br>
be a shell_surface.<br>
<br>
I suppose the answer to this whole problem is to remove the whole panel<br>
popup thing. It never had anything useful, right?<br>
<br>
<br>
Thanks,<br>
pq<br>
<div class="HOEnZb"><div class="h5"><br>
> On Mon, Apr 6, 2015 at 12:33 PM, Derek Foreman <<a href="mailto:derekf@osg.samsung.com">derekf@osg.samsung.com</a>><br>
> wrote:<br>
><br>
> > This bug was introduced in commits da6ecd0cc52 and 24185e2561<br>
> ><br>
> > I guess nobody right clicked on the panel for over a month. :)<br>
> ><br>
> > I've CC'd Jasper and Jonas in case they haven't noticed this yet...<br>
> ><br>
> > On 06/04/15 01:52 AM, Dima Ryazanov wrote:<br>
> > > It looks like the error-checking code assumes the popup's parent is<br>
> > > a shell surface - but that's not always the case.<br>
> > ><br>
> > > Signed-off-by: Dima Ryazanov <<a href="mailto:dima@gmail.com">dima@gmail.com</a>><br>
> > > ---<br>
> > >  desktop-shell/shell.c | 9 +++++----<br>
> > >  1 file changed, 5 insertions(+), 4 deletions(-)<br>
> > ><br>
> > > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c<br>
> > > index f7c928e..0159547 100644<br>
> > > --- a/desktop-shell/shell.c<br>
> > > +++ b/desktop-shell/shell.c<br>
> > > @@ -3392,7 +3392,7 @@ add_popup_grab(struct shell_surface *shsurf,<br>
> > ><br>
> > >       parent = get_shell_surface(shsurf->parent);<br>
> > >       top_surface = get_top_popup(shseat);<br>
> > > -     if (shell_surface_is_xdg_popup(shsurf) &&<br>
> > > +     if (parent && shell_surface_is_xdg_popup(shsurf) &&<br>
> ><br>
> > This part broke in da6ecd0cc52<br>
> ><br>
> > Your patch definitely stops the crash for me, which is good.  :)<br>
> ><br>
> > I think this part's ok, but I'm not 100% sure we're still going to send<br>
> > the new not-top-level-popup error when we're supposed to now...<br>
> ><br>
> > >           ((top_surface == NULL &&<br>
> > !shell_surface_is_xdg_surface(parent)) ||<br>
> > >            (top_surface != NULL && parent != top_surface))) {<br>
> > >               wl_resource_post_error(shsurf->owner->resource,<br>
> > > @@ -4098,12 +4098,13 @@ create_xdg_popup(struct shell_client *owner,<br>
> > void *shell,<br>
> > >  {<br>
> > >       struct shell_surface *shsurf, *parent_shsurf;<br>
> > ><br>
> > > -     /* Verify that we are creating the top most popup when mapping,<br>
> > > -      * as its not until then we know whether it was mapped as most<br>
> > > +     /* Verify that we are creating the topmost popup when mapping,<br>
> > > +      * as it's not until then we know whether it was mapped as most<br>
> > >        * top level or not. */<br>
> ><br>
> > The grammar fix-ups look good to me.<br>
> ><br>
> > >       parent_shsurf = get_shell_surface(parent);<br>
> > > -     if (!shell_surface_is_xdg_popup(parent_shsurf) &&<br>
> > > +     if (parent_shsurf &&<br>
> ><br>
> > This part broke in 24185e2561...<br>
> ><br>
> > I wonder if we should be doing a more comprehensive test here - it looks<br>
> > like some invalid parent resources could get past this test?<br>
> ><br>
> > > +         !shell_surface_is_xdg_popup(parent_shsurf) &&<br>
> > >           !shell_surface_is_xdg_surface(parent_shsurf)) {<br>
> > >               wl_resource_post_error(owner->resource,<br>
> > >                                      XDG_POPUP_ERROR_INVALID_PARENT,<br>
> > ><br>
> ><br>
> ><br>
> ><br>
<br>
</div></div></blockquote></div><br></div>