From b70edc437ca2cfcb87738a3eae2cf8b771ac835d Mon Sep 17 00:00:00 2001 From: o9000 Date: Thu, 18 Jan 2018 21:41:32 +0000 Subject: [PATCH] Possible fix for issue #693 --- src/button/button.c | 2 +- src/execplugin/execplugin.c | 2 +- src/taskbar/task.c | 2 +- src/util/common.h | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/button/button.c b/src/button/button.c index ec6e817..386be17 100644 --- a/src/button/button.c +++ b/src/button/button.c @@ -466,7 +466,7 @@ void draw_button(void *obj, cairo_t *c) PangoLayout *layout = pango_layout_new(context); pango_layout_set_font_description(layout, button->backend->font_desc); - pango_layout_set_width(layout, (button->frontend->textw + 1) * PANGO_SCALE); + pango_layout_set_width(layout, (button->frontend->textw + TINT2_PANGO_SLACK) * PANGO_SCALE); pango_layout_set_alignment(layout, button->backend->centered ? PANGO_ALIGN_CENTER : PANGO_ALIGN_LEFT); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); diff --git a/src/execplugin/execplugin.c b/src/execplugin/execplugin.c index 275373f..9bf019d 100644 --- a/src/execplugin/execplugin.c +++ b/src/execplugin/execplugin.c @@ -491,7 +491,7 @@ void draw_execp(void *obj, cairo_t *c) // draw layout pango_layout_set_font_description(layout, execp->backend->font_desc); - pango_layout_set_width(layout, (execp->frontend->textw + 1) * PANGO_SCALE); + pango_layout_set_width(layout, (execp->frontend->textw + TINT2_PANGO_SLACK) * PANGO_SCALE); pango_layout_set_alignment(layout, execp->backend->centered ? PANGO_ALIGN_CENTER : PANGO_ALIGN_LEFT); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_NONE); diff --git a/src/taskbar/task.c b/src/taskbar/task.c index d0e70ca..59cf2a7 100644 --- a/src/taskbar/task.c +++ b/src/taskbar/task.c @@ -465,7 +465,7 @@ void draw_task(void *obj, cairo_t *c) pango_layout_set_font_description(layout, panel->g_task.font_desc); pango_layout_set_text(layout, task->title, -1); - pango_layout_set_width(layout, (((Taskbar *)task->area.parent)->text_width + 1) * PANGO_SCALE); + pango_layout_set_width(layout, (((Taskbar *)task->area.parent)->text_width + TINT2_PANGO_SLACK) * PANGO_SCALE); pango_layout_set_height(layout, panel->g_task.text_height * PANGO_SCALE); pango_layout_set_wrap(layout, PANGO_WRAP_WORD_CHAR); pango_layout_set_ellipsize(layout, PANGO_ELLIPSIZE_END); diff --git a/src/util/common.h b/src/util/common.h index 339ad2c..68a6e12 100644 --- a/src/util/common.h +++ b/src/util/common.h @@ -7,6 +7,7 @@ #define COMMON_H #define WM_CLASS_TINT "panel" +#define TINT2_PANGO_SLACK 0 #include #include