Fixing wintitle and a few warning messages ref. #37

This commit is contained in:
bakkeby 2020-08-23 18:18:05 +02:00
parent 8ec80be756
commit 939a407e25
4 changed files with 10 additions and 5 deletions

View File

@ -70,7 +70,9 @@ static const char *fonts[] = { "monospace:size=10" };
#endif // BAR_PANGO_PATCH #endif // BAR_PANGO_PATCH
static const char dmenufont[] = "monospace:size=10"; static const char dmenufont[] = "monospace:size=10";
#if BAR_FLEXWINTITLE_PATCH
static char c000000[] = "#000000"; // placeholder value static char c000000[] = "#000000"; // placeholder value
#endif // BAR_FLEXWINTITLE_PATCH
static char normfgcolor[] = "#bbbbbb"; static char normfgcolor[] = "#bbbbbb";
static char normbgcolor[] = "#222222"; static char normbgcolor[] = "#222222";
static char normbordercolor[] = "#444444"; static char normbordercolor[] = "#444444";

6
dwm.c
View File

@ -88,6 +88,7 @@
#endif // SCRATCHPADS_PATCH #endif // SCRATCHPADS_PATCH
#define TEXTWM(X) (drw_fontset_getwidth(drw, (X), True) + lrpad) #define TEXTWM(X) (drw_fontset_getwidth(drw, (X), True) + lrpad)
#define TEXTW(X) (drw_fontset_getwidth(drw, (X), False) + lrpad) #define TEXTW(X) (drw_fontset_getwidth(drw, (X), False) + lrpad)
#define HIDDEN(C) ((getstate(C->win) == IconicState))
/* enums */ /* enums */
enum { enum {
@ -1280,7 +1281,10 @@ Monitor *
createmon(void) createmon(void)
{ {
Monitor *m, *mon; Monitor *m, *mon;
int i, n, mi, max_bars = 2, istopbar = topbar, layout; int i, n, mi, max_bars = 2, istopbar = topbar;
#if MONITOR_RULES_PATCH
int layout;
#endif // MONITOR_RULES_PATCH
const BarRule *br; const BarRule *br;
Bar *bar; Bar *bar;

View File

@ -30,7 +30,8 @@ draw_wintitle(Bar *bar, BarDrawArg *a)
XSetErrorHandler(xerrordummy); XSetErrorHandler(xerrordummy);
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
#if BAR_CENTEREDWINDOWNAME_PATCH #if BAR_CENTEREDWINDOWNAME_PATCH
pad = (m->ww - TEXTW(m->sel->name)) / 2 - x; if (TEXTW(m->sel->name) < w)
pad = (w - TEXTW(m->sel->name) + lrpad) / 2;
#endif // BAR_CENTEREDWINDOWNAME_PATCH #endif // BAR_CENTEREDWINDOWNAME_PATCH
drw_text(drw, x, 0, w, bh, pad, m->sel->name, 0, False); drw_text(drw, x, 0, w, bh, pad, m->sel->name, 0, False);
#if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH #if BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
@ -38,7 +39,7 @@ draw_wintitle(Bar *bar, BarDrawArg *a)
XSetErrorHandler(xerror); XSetErrorHandler(xerror);
#endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH #endif // BAR_IGNORE_XFT_ERRORS_WHEN_DRAWING_TEXT_PATCH
if (m->sel->isfloating) if (m->sel->isfloating)
drawindicator(m, m->sel, 1, x, w, 0, 0, c->isfixed, floatindicatortype); drawindicator(m, m->sel, 1, x, w, 0, 0, m->sel->isfixed, floatindicatortype);
return 1; return 1;
} }

View File

@ -1,5 +1,3 @@
#define HIDDEN(C) ((getstate(C->win) == IconicState))
static void hide(Client *c); static void hide(Client *c);
static void show(Client *c); static void show(Client *c);
static void togglewin(const Arg *arg); static void togglewin(const Arg *arg);