[PATCH 4/6] cairo-util: Don't show a resize cursor on edges when we're maximized

Kristian Høgsberg hoegsberg at gmail.com
Wed Apr 30 21:03:58 PDT 2014


On Mon, Apr 28, 2014 at 11:19:30AM -0400, Jasper St. Pierre wrote:
> This is substantially confusing to users, namely me.

That is indeed confusing.  However, I edited the patch to just set grip_size
to 0 if we're maximized.

Kristian

> ---
>  shared/cairo-util.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/shared/cairo-util.c b/shared/cairo-util.c
> index a1568ff..a77d0b6 100644
> --- a/shared/cairo-util.c
> +++ b/shared/cairo-util.c
> @@ -487,11 +487,14 @@ enum theme_location
>  theme_get_location(struct theme *t, int x, int y,
>  				int width, int height, int flags)
>  {
> +	int maximized;
>  	int vlocation, hlocation, location;
>  	const int grip_size = 8;
>  	int margin, top_margin;
>  
> -	margin = (flags & THEME_FRAME_MAXIMIZED) ? 0 : t->margin;
> +	maximized = (flags & THEME_FRAME_MAXIMIZED);
> +
> +	margin = maximized ? 0 : t->margin;
>  
>  	if (flags & THEME_FRAME_NO_TITLE)
>  		top_margin = t->width;
> @@ -500,22 +503,22 @@ theme_get_location(struct theme *t, int x, int y,
>  
>  	if (x < margin)
>  		hlocation = THEME_LOCATION_EXTERIOR;
> -	else if (x < margin + grip_size)
> +	else if (!maximized && x < margin + grip_size)
>  		hlocation = THEME_LOCATION_RESIZING_LEFT;
>  	else if (x < width - margin - grip_size)
>  		hlocation = THEME_LOCATION_INTERIOR;
> -	else if (x < width - margin)
> +	else if (!maximized && x < width - margin)
>  		hlocation = THEME_LOCATION_RESIZING_RIGHT;
>  	else
>  		hlocation = THEME_LOCATION_EXTERIOR;
>  
>  	if (y < margin)
>  		vlocation = THEME_LOCATION_EXTERIOR;
> -	else if (y < margin + grip_size)
> +	else if (!maximized && y < margin + grip_size)
>  		vlocation = THEME_LOCATION_RESIZING_TOP;
>  	else if (y < height - margin - grip_size)
>  		vlocation = THEME_LOCATION_INTERIOR;
> -	else if (y < height - margin)
> +	else if (!maximized && y < height - margin)
>  		vlocation = THEME_LOCATION_RESIZING_BOTTOM;
>  	else
>  		vlocation = THEME_LOCATION_EXTERIOR;
> -- 
> 1.9.0
> 
> _______________________________________________
> 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