From 2cf37aa49209f2ad702dd4ec13d111f3c4a610ee Mon Sep 17 00:00:00 2001 From: bakkeby Date: Fri, 24 Jul 2020 11:15:44 +0200 Subject: [PATCH] status2d: rawstext may not exist if neither statuscmd nor the extrabar patch is used --- patch/bar_status2d.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c index e746ac6..f98e27a 100644 --- a/patch/bar_status2d.c +++ b/patch/bar_status2d.c @@ -1,28 +1,44 @@ int width_status2d(Bar *bar, BarWidthArg *a) { + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH return status2dtextlength(rawstext) + lrpad; + #else + return status2dtextlength(stext) + lrpad; + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH } #if BAR_EXTRASTATUS_PATCH int width_status2d_es(Bar *bar, BarWidthArg *a) { - return status2dtextlength(rawestext); + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH + return status2dtextlength(rawestext) + lrpad; + #else + return status2dtextlength(estext) + lrpad; + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH } #endif // BAR_EXTRASTATUS_PATCH int draw_status2d(Bar *bar, BarDrawArg *a) { + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH return drawstatusbar(a->x, rawstext); + #else + return drawstatusbar(a->x, stext); + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH } #if BAR_EXTRASTATUS_PATCH int draw_status2d_es(Bar *bar, BarDrawArg *a) { + #if BAR_EXTRASTATUS_PATCH || BAR_STATUSCMD_PATCH return drawstatusbar(a->x, rawestext); + #else + return drawstatusbar(a->x, estext); + #endif // #if BAR_EXTRASTATUS_PATCH | BAR_STATUSCMD_PATCH } #endif // BAR_EXTRASTATUS_PATCH