[PATCH weston] desktop-shell: Don't resize into the panel

Boyan Ding stu_dby at 126.com
Wed Jun 25 22:39:24 PDT 2014


Oh, sorry I didn't go through the mails carefully...

On Thu, 2014-06-26 at 05:26 +0000, Vivek Ellur wrote:
> Hi,
> 
> I think you have duplicated the effort :). I had submitted the patch
> for the same bug few days before.
> 
> http://lists.freedesktop.org/archives/wayland-devel/2014-June/015528.html. 
> 
> Regards,
> 
> Vivek Ellur
> 
>  
> 
> ------- Original Message -------
> 
> Sender : Boyan Ding<stu_dby at 126.com>
> 
> Date : Jun 26, 2014 09:21 (GMT+05:30)
> 
> Title : [PATCH weston] desktop-shell: Don't resize into the panel
> 
>  
> 
> Previously we can resize windows into panel in weston. This patch puts
> a constraint in position when resizing just like what was done in
> moving to avoid resizing window into the panel.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=80228
> Signed-off-by: Boyan Ding 
> ---
> desktop-shell/shell.c | 35 ++++++++++++++++++++++++++++++-----
> 1 file changed, 30 insertions(+), 5 deletions(-)
> 
> diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
> index d267cde..eccfa1e 100644
> --- a/desktop-shell/shell.c
> +++ b/desktop-shell/shell.c
> @@ -1689,6 +1689,35 @@ struct weston_resize_grab {
> };
> 
> static void
> +constrain_resize_position(struct weston_resize_grab *resize,
> +   wl_fixed_t *from_x, wl_fixed_t *from_y,
> +   wl_fixed_t *to_x, wl_fixed_t *to_y)
> +{
> + struct shell_surface *shsurf = resize->base.shsurf;
> + struct weston_pointer *pointer = resize->base.grab.pointer;
> + int panel_height;
> + wl_fixed_t grab_x, grab_y, x, y, panel_height_fixed;
> +
> + grab_x = pointer->grab_x;
> + grab_y = pointer->grab_y;
> + x = pointer->x;
> + y = pointer->y;
> +
> + panel_height = get_output_panel_height(shsurf->shell,
> +        shsurf->surface->output);
> + panel_height_fixed = wl_fixed_from_int(panel_height);
> +
> + if (grab_y < panel_height_fixed)
> + grab_y = panel_height_fixed;
> + if (y < panel_height_fixed)
> + y = panel_height_fixed;
> +
> + weston_view_from_global_fixed(shsurf->view, grab_x, grab_y,
> +       from_x, from_y);
> + weston_view_from_global_fixed(shsurf->view, x, y, to_x, to_y);
> +}
> +
> +static void
> resize_grab_motion(struct weston_pointer_grab *grab, uint32_t time,
>    wl_fixed_t x, wl_fixed_t y)
> {
> @@ -1704,11 +1733,7 @@ resize_grab_motion(struct weston_pointer_grab
> *grab, uint32_t time,
> if (!shsurf)
> return;
> 
> - weston_view_from_global_fixed(shsurf->view,
> -       pointer->grab_x, pointer->grab_y,
> -       &from_x, &from_y);
> - weston_view_from_global_fixed(shsurf->view,
> -       pointer->x, pointer->y, &to_x, &to_y);
> + constrain_resize_position(resize, &from_x, &from_y, &to_x, &to_y);
> 
> width = resize->width;
> if (resize->edges & WL_SHELL_SURFACE_RESIZE_LEFT) {
> -- 
> 2.0.0
> 
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 
> 
>  
> 
>  
> 
>  
> 
> 
> 
> 
> 
> 1 attachments
> 201406261057484_QKNMBDIF.gif(13K)
>         download preview 





More information about the wayland-devel mailing list