summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn <sabetts@juicebox>2008-05-25 00:18:17 -0700
committerShawn <sabetts@juicebox>2008-05-25 00:18:17 -0700
commit98503f1fa2abd896c91a186c1f1670932a14ed63 (patch)
treeb9195d9b2a045740709b9db63091a0407b6850be
parent4be06410d03bcbcde5707e317c321a482cb32214 (diff)
downloadratpoison-98503f1fa2abd896c91a186c1f1670932a14ed63.zip
change -1 to the proper string length in some calls to rp_text_width and rp_draw_string
-rw-r--r--src/bar.c12
-rw-r--r--src/split.c2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/bar.c b/src/bar.c
index 8c877d3..41c1002 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -262,7 +262,7 @@ max_line_length (char* msg)
int current_width;
/* Check if this line is the longest so far. */
- current_width = rp_text_width (s, defaults.font, msg + start, -1);
+ current_width = rp_text_width (s, defaults.font, msg + start, i - start);
if(current_width > ret)
{
ret = current_width;
@@ -339,8 +339,9 @@ draw_string (rp_screen *s, char *msg)
{
rp_draw_string (s, s->bar_window, s->normal_gc,
defaults.bar_x_padding,
- defaults.bar_y_padding + FONT_ASCENT(s),
- msg + start, -1);
+ defaults.bar_y_padding + FONT_ASCENT(s)
+ + line_no * line_height,
+ msg + start, i - start);
line_no++;
start = i + 1;
}
@@ -349,8 +350,9 @@ draw_string (rp_screen *s, char *msg)
/* Print the last line. */
rp_draw_string (s, s->bar_window, s->normal_gc,
defaults.bar_x_padding,
- defaults.bar_y_padding + FONT_ASCENT(s),
- msg + start, -1);
+ defaults.bar_y_padding + FONT_ASCENT(s)
+ + line_no * line_height,
+ msg + start, strlen (msg) - start);
XSync (dpy, False);
}
diff --git a/src/split.c b/src/split.c
index 45671c2..e27e277 100644
--- a/src/split.c
+++ b/src/split.c
@@ -1021,7 +1021,7 @@ show_frame_message (char *msg)
rp_draw_string (s, s->frame_window, s->normal_gc,
defaults.bar_x_padding,
defaults.bar_y_padding + FONT_ASCENT(s),
- msgbuf->data, -1);
+ msgbuf->data, msgbuf->len);
sbuf_free (msgbuf);
}