]> git.sur5r.net Git - i3/i3/blobdiff - libi3/draw_util.c
Fix: render_con shows floating containers on wrong workspace
[i3/i3] / libi3 / draw_util.c
index e4f0d065abcb9b010cbb49fe60af73ca4b48ae96..f88360dc32ecab74a146a6e7e35789c9c35efc0b 100644 (file)
@@ -84,6 +84,11 @@ void draw_util_surface_set_size(surface_t *surface, int width, int height) {
  *
  */
 color_t draw_util_hex_to_color(const char *color) {
+    if (strlen(color) < 6 || color[0] != '#') {
+        ELOG("Could not parse color: %s\n", color);
+        return draw_util_hex_to_color("#A9A9A9");
+    }
+
     char alpha[2];
     if (strlen(color) == strlen("#rrggbbaa")) {
         alpha[0] = color[7];
@@ -116,7 +121,7 @@ static void draw_util_set_source_color(surface_t *surface, color_t color) {
     cairo_set_source_rgba(surface->cr, color.red, color.green, color.blue, color.alpha);
 }
 
-/**
+/*
  * Draw the given text using libi3.
  * This function also marks the surface dirty which is needed if other means of
  * drawing are used. This will be the case when using XCB to draw text.
@@ -135,7 +140,7 @@ void draw_util_text(i3String *text, surface_t *surface, color_t fg_color, color_
     cairo_surface_mark_dirty(surface->surface);
 }
 
-/**
+/*
  * Draws a filled rectangle.
  * This function is a convenience wrapper and takes care of flushing the
  * surface as well as restoring the cairo state.
@@ -162,7 +167,7 @@ void draw_util_rectangle(surface_t *surface, color_t color, double x, double y,
     cairo_restore(surface->cr);
 }
 
-/**
+/*
  * Clears a surface with the given color.
  *
  */
@@ -186,7 +191,7 @@ void draw_util_clear_surface(surface_t *surface, color_t color) {
     cairo_restore(surface->cr);
 }
 
-/**
+/*
  * Copies a surface onto another surface.
  *
  */