[PATCH weston v2] clients: If available, prefer top level surfaces for move or rotate

Bryce Harrington bryce at osg.samsung.com
Tue Sep 15 06:43:33 PDT 2015


On Fri, Sep 11, 2015 at 05:57:39PM -0700, Bryce Harrington wrote:
> On Fri, Sep 11, 2015 at 02:27:40PM -0500, Derek Foreman wrote:
> > This stops us from rotating or moving pop-up menus by instead rotating
> > their parents.
> > 
> > This is easiest to see using a multi-seat configuration.
> > 
> > Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
> 
> One minor suggestion below, but no biggie.

Thanks, merged to trunk:

To ssh://git.freedesktop.org/git/wayland/weston
   ca510d0..c0c1497  master -> master
 
> Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
> 
> > ---
> >  desktop-shell/shell.c | 21 +++++++++++++++++++++
> >  1 file changed, 21 insertions(+)
> > 
> > diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> > index 034d39b..90a3ded 100644
> > --- a/desktop-shell/shell.c
> > +++ b/desktop-shell/shell.c
> > @@ -481,6 +481,23 @@ get_output_work_area(struct desktop_shell *shell,
> >  	}
> >  }
> >  
> > +static struct shell_surface *
> > +find_toplevel_surface(struct shell_surface *in_surface)
> > +{
> > +	struct shell_surface *surface = in_surface;
> > +
> > +	if (!surface)
> > +		return NULL;
> > +
> > +	while (surface->parent)
> > +		surface = get_shell_surface(surface->parent);
> > +
> > +	if (!surface || surface->type != SHELL_SURFACE_TOPLEVEL)
> > +		surface = in_surface;
> 
> A comment to explain what we're doing here might be helpful.
> Like:
> 
> /* If no top level surface was found, just use whatever surface was
>    originally provided. */
> 
> > +
> > +	return surface;
> > +}
> > +
> >  static void
> >  send_configure_for_surface(struct shell_surface *shsurf)
> >  {
> > @@ -1770,6 +1787,8 @@ surface_move(struct shell_surface *shsurf, struct weston_pointer *pointer,
> >  	if (!shsurf)
> >  		return -1;
> >  
> > +	shsurf = find_toplevel_surface(shsurf);
> > +
> >  	if (shsurf->grabbed ||
> >  	    shsurf->state.fullscreen || shsurf->state.maximized)
> >  		return 0;
> > @@ -4993,6 +5012,8 @@ surface_rotate(struct shell_surface *surface, struct weston_pointer *pointer)
> >  	float dx, dy;
> >  	float r;
> >  
> > +	surface = find_toplevel_surface(surface);
> > +
> >  	rotate = malloc(sizeof *rotate);
> >  	if (!rotate)
> >  		return;
> > -- 
> > 2.5.1
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list