From c2a5b526e25be489b1e7e0ef82ce79b4501b2aae Mon Sep 17 00:00:00 2001 From: Sascha Kruse Date: Sat, 2 Mar 2013 17:22:12 +0100 Subject: [PATCH] fix expanding window across the screen test case included --- test/test.sh | 8 +++++++- x.c | 8 +++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/test/test.sh b/test/test.sh index 0f90d36..901e0d9 100755 --- a/test/test.sh +++ b/test/test.sh @@ -145,7 +145,13 @@ function geometry { killall dunst ../dunst -config dunstrc.default -geom "-300x1-20-20" & - ../dunstify -a "dunst tester" -u c "-300x1-20-20" + ../dunstify -a "dunst tester" -u c "-300x1-20-20" + basic_notifications + keypress + + killall dunst + ../dunst -config dunstrc.default -geom "x1" & + ../dunstify -a "dunst tester" -u c "x1-20-20" "across the screen" basic_notifications keypress } diff --git a/x.c b/x.c index 17dd5aa..863b0b3 100644 --- a/x.c +++ b/x.c @@ -204,7 +204,7 @@ static colored_layout *r_init_shared(cairo_t *c, notification *n) cl->bg = x_string_to_color_t(n->color_strings[ColBG]); int width = calculate_width(); - if (xctx.geometry.w > 0) { + if (width) { width -= 2 * settings.h_padding; width -= 2 * settings.frame_width; r_setup_pango_layout(cl->l, width); @@ -309,10 +309,8 @@ void x_win_draw(void) text_width = MAX(w, text_width); } - int width; - if (xctx.geometry.w > 0) - width = xctx.geometry.w; - else { + int width = calculate_width(); + if (width <= 0) { width = text_width + 2 * settings.h_padding; width += 2 * settings.frame_width; }