[PATCH 1/2] client: tablet-shell: fallback in the lack of lockscreen icon

Kristian Hoegsberg hoegsberg at gmail.com
Tue Apr 3 11:54:11 PDT 2012


On Wed, Mar 28, 2012 at 08:56:48PM +0300, Tiago Vignatti wrote:
> lockscreen, homescreen and shell launchers are falling back okay already and
> only lockscreen icon was missing some way to keep the shell client running in
> the absence of images. This patch fix it.

Thanks, comitted.
Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  clients/tablet-shell.c |   16 +++++++++++-----
>  1 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/clients/tablet-shell.c b/clients/tablet-shell.c
> index e486782..4f4eec5 100644
> --- a/clients/tablet-shell.c
> +++ b/clients/tablet-shell.c
> @@ -197,11 +197,17 @@ lockscreen_draw(struct widget *widget, void *data)
>  
>  	cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
>  	icon = load_cairo_surface(key_lockscreen_icon);
> -	width = cairo_image_surface_get_width(icon);
> -	height = cairo_image_surface_get_height(icon);
> -	cairo_set_source_surface(cr, icon,
> -				 allocation.x + (allocation.width - width) / 2,
> -				 allocation.y + (allocation.height - height) / 2);
> +	if (icon) {
> +		width = cairo_image_surface_get_width(icon);
> +		height = cairo_image_surface_get_height(icon);
> +		cairo_set_source_surface(cr, icon,
> +			allocation.x + (allocation.width - width) / 2,
> +			allocation.y + (allocation.height - height) / 2);
> +	} else {
> +		fprintf(stderr, "couldn't load lockscreen icon: %s\n",
> +				 key_lockscreen_icon);
> +		cairo_set_source_rgb(cr, 0.2, 0, 0);
> +	}
>  	cairo_paint(cr);
>  	cairo_destroy(cr);
>  	cairo_surface_destroy(icon);
> -- 
> 1.7.5.4
> 
> _______________________________________________
> 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