[PATCH weston] wm: Don't subtract the margins from the configured size

Pekka Paalanen ppaalanen at gmail.com
Wed Aug 27 07:24:42 PDT 2014


On Wed, 27 Aug 2014 09:38:33 -0400
"Jasper St. Pierre" <jstpierre at mecheye.net> wrote:

> When we moved the configure event size to being based on the window
> geometry, we changed the coordinates of the configure request to being
> frame geometry based. Frame geometry includes titlebar and border, but
> not shadow margins.
> ---
>  xwayland/window-manager.c | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c
> index f1523f5..a216b76 100644
> --- a/xwayland/window-manager.c
> +++ b/xwayland/window-manager.c
> @@ -2188,15 +2188,12 @@ send_configure(struct weston_surface *surface, int32_t width, int32_t height)
>  	struct theme *t = window->wm->theme;
>  	int vborder, hborder;
>  
> -	if (window->fullscreen) {
> +	if (window->decorate) {
> +		hborder = 2 * t->width;
> +		vborder = t->titlebar_height + t->width;
> +	} else {
>  		hborder = 0;
>  		vborder = 0;
> -	} else if (window->decorate) {
> -		hborder = 2 * (t->margin + t->width);
> -		vborder = 2 * t->margin + t->titlebar_height + t->width;
> -	} else {
> -		hborder = 2 * t->margin;
> -		vborder = 2 * t->margin;
>  	}
>  
>  	if (width > hborder)

Hi,

yup, this works well, and resizing works correctly even if the window
is rotated. :-)

Pushed.


Thanks,
pq


More information about the wayland-devel mailing list