We don't need to crop at that point

This commit is contained in:
Axel Wagner 2010-09-17 01:51:10 +02:00
parent 2ce9c4024f
commit c5dc3d49aa
1 changed files with 1 additions and 4 deletions

View File

@ -124,16 +124,13 @@ uint32_t get_colorpixel(const char *s) {
*/ */
void refresh_statusline() { void refresh_statusline() {
int glyph_count; int glyph_count;
uint32_t root_width = xcb_screens->width_in_pixels;
if (statusline == NULL) { if (statusline == NULL) {
return; return;
} }
xcb_char2b_t *text = (xcb_char2b_t*) convert_utf8_to_ucs2(statusline, &glyph_count); xcb_char2b_t *text = (xcb_char2b_t*) convert_utf8_to_ucs2(statusline, &glyph_count);
statusline_width = predict_text_extents(text, glyph_count); statusline_width = predict_text_extents(text, glyph_count);
int crop_x = MIN(0, ((int32_t)root_width) - ((int32_t)statusline_width));
printf("Cropping statusline with %d glyphs at x=%d\n", glyph_count, crop_x);
statusline_width = MIN((int32_t)statusline_width, (int32_t)root_width);
xcb_free_pixmap(xcb_connection, statusline_pm); xcb_free_pixmap(xcb_connection, statusline_pm);
statusline_pm = xcb_generate_id(xcb_connection); statusline_pm = xcb_generate_id(xcb_connection);