Hi Philipp,<br><br>I happened across your patch and wanted to comment about the styling. (see below)<br><br><div class="gmail_quote">On Tue, Aug 28, 2012 at 11:10 AM, Philipp Brüschweiler <span dir="ltr"><<a href="mailto:blei42@gmail.com" target="_blank">blei42@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Instead load a fallback icon and proceed as normal.<br>
<br>
<a href="https://bugs.freedesktop.org/show_bug.cgi?id=53860" target="_blank">https://bugs.freedesktop.org/show_bug.cgi?id=53860</a><br>
---<br>
clients/desktop-shell.c | 19 ++++++++++++++++++-<br>
1 Datei geändert, 18 Zeilen hinzugefügt(+), 1 Zeile entfernt(-)<br>
<br>
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c<br>
index dc87e75..fe8fe02 100644<br>
--- a/clients/desktop-shell.c<br>
+++ b/clients/desktop-shell.c<br>
@@ -472,6 +472,23 @@ panel_create(struct display *display)<br>
return panel;<br>
}<br>
<br>
+static cairo_surface_t *<br>
+load_icon_or_fallback(const char *icon)<br>
+{<br>
+ cairo_surface_t *surface = cairo_image_surface_create_from_png(icon);<br>
+<br>
+ if (cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS)<br>
+ return surface;<br>
+<br>
+ fprintf(stderr, "ERROR loading icon from file '%s'\n", icon);<br>
+<br>
+ // loading fallback<br></blockquote><div><br>For comments in weston, we use C style /* Comment here */<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ surface = cairo_image_surface_create_from_png(<br>
+ DATADIR "/weston/icon_window.png");<br></blockquote><div><br>You might be able to arrange this differently, such as<br><br>surface =<br> cairo_image_surface_create_from_png(DATADIR<br> "/weston/icon_window.png");<br>
<br>so you don't have a function(\n.<br>You can use about 80 characters before starting a new line.<br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+ return surface;<br>
+}<br>
+<br>
static void<br>
panel_add_launcher(struct panel *panel, const char *icon, const char *path)<br>
{<br>
@@ -481,7 +498,7 @@ panel_add_launcher(struct panel *panel, const char *icon, const char *path)<br>
<br>
launcher = malloc(sizeof *launcher);<br>
memset(launcher, 0, sizeof *launcher);<br>
- launcher->icon = cairo_image_surface_create_from_png(icon);<br>
+ launcher->icon = load_icon_or_fallback(icon);<br>
launcher->path = strdup(path);<br>
<br>
wl_array_init(&launcher->envp);<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.7.12<br><br></font></span></blockquote><div><br>Regards,<br><br>Scott <br></div></div><br>