client: tablet-shell: fallback in the lack of lockscreen icon

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.

Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
dev
Tiago Vignatti 13 years ago committed by Kristian Høgsberg
parent 610a3f2922
commit d081020435
  1. 6
      clients/tablet-shell.c

@ -197,11 +197,17 @@ lockscreen_draw(struct widget *widget, void *data)
cairo_set_operator(cr, CAIRO_OPERATOR_OVER); cairo_set_operator(cr, CAIRO_OPERATOR_OVER);
icon = load_cairo_surface(key_lockscreen_icon); icon = load_cairo_surface(key_lockscreen_icon);
if (icon) {
width = cairo_image_surface_get_width(icon); width = cairo_image_surface_get_width(icon);
height = cairo_image_surface_get_height(icon); height = cairo_image_surface_get_height(icon);
cairo_set_source_surface(cr, icon, cairo_set_source_surface(cr, icon,
allocation.x + (allocation.width - width) / 2, allocation.x + (allocation.width - width) / 2,
allocation.y + (allocation.height - height) / 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_paint(cr);
cairo_destroy(cr); cairo_destroy(cr);
cairo_surface_destroy(icon); cairo_surface_destroy(icon);

Loading…
Cancel
Save