don't wordwrap if width == 0
This commit is contained in:
parent
8c0b27f323
commit
e5aed09224
7
dunst.c
7
dunst.c
@ -365,7 +365,7 @@ void update_lists()
|
|||||||
/* TODO get draw_txt_buf as argument */
|
/* TODO get draw_txt_buf as argument */
|
||||||
int do_word_wrap(char *source, int max_width)
|
int do_word_wrap(char *source, int max_width)
|
||||||
{
|
{
|
||||||
if (!word_wrap)
|
if (!word_wrap || max_width < 1)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
strtrim_end(source);
|
strtrim_end(source);
|
||||||
@ -526,6 +526,7 @@ void draw_win(void)
|
|||||||
line_cnt += n->draw_txt_buf.line_count;
|
line_cnt += n->draw_txt_buf.line_count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("width: %d\n", width);
|
||||||
/* if we have a dynamic width, calculate the actual width */
|
/* if we have a dynamic width, calculate the actual width */
|
||||||
if (width == 0) {
|
if (width == 0) {
|
||||||
for (l_node * iter = displayed_notifications->head; iter;
|
for (l_node * iter = displayed_notifications->head; iter;
|
||||||
@ -540,6 +541,10 @@ void draw_win(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
printf("width: %d\n", width);
|
||||||
|
|
||||||
|
printf("------\n");
|
||||||
|
|
||||||
/* calculate height */
|
/* calculate height */
|
||||||
if (geometry.h == 0) {
|
if (geometry.h == 0) {
|
||||||
height = line_cnt * line_height;
|
height = line_cnt * line_height;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user