summaryrefslogtreecommitdiff
path: root/drw.c
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2020-10-05 19:40:36 -0400
committerBenjamin Chausse <benjamin@chausse.xyz>2020-10-05 19:40:36 -0400
commitaabcf257f5a022dd482b8ea53dd66b20eff7917a (patch)
treeae72833568d23e73d5deefd7007d2a05765da1ab /drw.c
parent61bb8b2241d4db08bea4261c82e27cd9797099e7 (diff)
First rebuilt functional setup with sxhkd
Diffstat (limited to 'drw.c')
-rw-r--r--drw.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drw.c b/drw.c
index 4cdbcbe..a7cace7 100644
--- a/drw.c
+++ b/drw.c
@@ -11,6 +11,8 @@
#define UTF_INVALID 0xFFFD
#define UTF_SIZ 4
+int has_libxft_bgra = 0;
+
static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
static const long utfmin[UTF_SIZ + 1] = { 0, 0, 0x80, 0x800, 0x10000};
@@ -140,11 +142,13 @@ xfont_create(Drw *drw, const char *fontname, FcPattern *fontpattern)
* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=916349
* and lots more all over the internet.
*/
- FcBool iscol;
- if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
- XftFontClose(drw->dpy, xfont);
- return NULL;
- }
+ if (!has_libxft_bgra){
+ FcBool iscol;
+ if(FcPatternGetBool(xfont->pattern, FC_COLOR, 0, &iscol) == FcResultMatch && iscol) {
+ XftFontClose(drw->dpy, xfont);
+ return NULL;
+ }
+ }
font = ecalloc(1, sizeof(Fnt));
font->xfont = xfont;
@@ -175,6 +179,8 @@ drw_fontset_create(Drw* drw, const char *fonts[], size_t fontcount)
if (!drw || !fonts)
return NULL;
+ has_libxft_bgra = !system("pacman -Q libxft | grep bgra > /dev/null 2> /dev/null");
+
for (i = 1; i <= fontcount; i++) {
if ((cur = xfont_create(drw, fonts[fontcount - i], NULL))) {
cur->next = ret;