summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Grytsenko <andrej@rep.kiev.ua>2014-09-14 19:25:17 +0300
committerAndriy Grytsenko <andrej@rep.kiev.ua>2014-09-14 19:25:17 +0300
commitf682adcb0fcbe3ce517a223adc537cb90555e081 (patch)
tree5523c97d5f3503c544ec4175bca49accd3fd30c8
parent8e2386255796c41dddc2afa180b77e4a724c47ab (diff)
Fix crash in preview of theme with zero window border width.
-rw-r--r--src/preview.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/preview.c b/src/preview.c
index 2ed8ab4..8a5457b 100644
--- a/src/preview.c
+++ b/src/preview.c
@@ -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;