From 7da72b79efca6c37f8a6da427ea5b2cb860d574d Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 26 Sep 2013 09:51:21 -0400 Subject: [PATCH] Added define that fixes text not being visible on rxvt-unicode. --- src/toxic_windows.h | 4 ++++ src/windows.c | 19 +++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/toxic_windows.h b/src/toxic_windows.h index 2a8ddfa..03133e3 100644 --- a/src/toxic_windows.h +++ b/src/toxic_windows.h @@ -37,6 +37,10 @@ #define MAGENTA 6 #define BLACK 7 +/* Fixes text color problem on some terminals. + Uncomment if necessary */ +//#define URXVT_FIX + typedef struct ToxWindow_ ToxWindow; struct ToxWindow_ { diff --git a/src/windows.c b/src/windows.c index 91a8e97..33e3235 100644 --- a/src/windows.c +++ b/src/windows.c @@ -154,8 +154,10 @@ int add_window(Tox *m, ToxWindow w) if (w.window == NULL) return -1; - - wbkgd(w.window, COLOR_PAIR(0)); +#ifdef URXVT_FIX + /* Fixes text color problem on some terminals. */ + wbkgd(w.window, COLOR_PAIR(6)); +#endif windows[i] = w; w.onInit(&w, m); @@ -245,8 +247,13 @@ static void draw_bar() for (i = 0; i < MAX_WINDOWS_NUM; ++i) { if (windows[i].window) { - if (windows + i == active_window) + if (windows + i == active_window) { +#ifdef URXVT_FIX + attron(A_BOLD | COLOR_PAIR(GREEN)); + } else { +#endif attron(A_BOLD); + } odd = (odd + 1) % blinkrate; @@ -259,7 +266,11 @@ static void draw_bar() if (windows[i].blink && (odd < (blinkrate / 2))) attroff(COLOR_PAIR(RED)); - if (windows + i == active_window) { + if (windows + i == active_window) { +#ifdef URXVT_FIX + attroff(A_BOLD | COLOR_PAIR(GREEN)); + } else { +#endif attroff(A_BOLD); } }