Skip to content

Commit

Permalink
Fix crash in preview of theme with zero window border width.
Browse files Browse the repository at this point in the history
  • Loading branch information
LStranger committed Sep 14, 2014
1 parent 8e23862 commit f682adc
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/preview.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,12 +740,15 @@ static GdkPixbuf* preview_window(RrTheme *theme, const gchar *titlelayout,
w = width - 2*theme->fbwidth;
h = theme->fbwidth;

scratch = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
gdk_pixbuf_fill(scratch, rr_color_pixel(focus ?
theme->title_separator_focused_color :
theme->title_separator_unfocused_color));

gdk_pixbuf_copy_area(scratch, 0, 0, w, h, pixbuf, x, y);
if (h > 0)
{
scratch = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, w, h);
gdk_pixbuf_fill(scratch, rr_color_pixel(focus ?
theme->title_separator_focused_color :
theme->title_separator_unfocused_color));

gdk_pixbuf_copy_area(scratch, 0, 0, w, h, pixbuf, x, y);
}

/* retarded way of adding client colour */
x = theme->fbwidth;
Expand Down

0 comments on commit f682adc

Please sign in to comment.