From c6f2982855399872d553948799429ef34070fc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AB=8F=E8=A8=AA=E5=AD=90?= Date: Sat, 17 Jan 2026 18:39:32 +0900 Subject: [PATCH] =?UTF-8?q?=E3=81=94=E3=82=81=E3=82=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/display.c | 5 +++-- src/utils.c | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/display.c b/src/display.c index d6ae93d..f21bd80 100644 --- a/src/display.c +++ b/src/display.c @@ -6,7 +6,8 @@ void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) { unsigned long curbg = btn->pressed ? BTSEL : BTCOL; XSetForeground(ui->display, ui->gc, curbg); - XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y, btn->width, btn->height); + XFillRectangle(ui->display, ui->target, ui->gc, btn->x, btn->y, + btn->width, btn->height); // 文字の中央に if (btn->label && ui->font && xftdraw) { @@ -24,7 +25,7 @@ void drawbuttons(UiSystem *ui, SuwaButton *btn, XftDraw *xftdraw) { // tx -= extents.x; - XftDrawStringUtf8(xftdraw, &ui->textcolor, ui->font, tx, ty, + XftDrawStringUtf8(xftdraw, &ui->color, ui->font, tx, ty, (FcChar8 *)btn->label, len); } } diff --git a/src/utils.c b/src/utils.c index 7c2bb44..8935f96 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,6 +1,8 @@ #include "utils.h" void cleanup(UiSystem *ui) { + if (ui->textcolor.pixel != 0) + XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->textcolor); if (ui->btncolor.pixel != 0) XftColorFree(ui->display, &ui->visual, ui->colormap, &ui->btncolor); if (ui->color.pixel != 0)