diff options
Diffstat (limited to 'st.c')
| -rw-r--r-- | st.c | 22 |
1 files changed, 16 insertions, 6 deletions
| @@ -2887,7 +2887,8 @@ xhints(void) { | |||
| 2887 | sizeh->min_height = sizeh->max_height = xw.fh; | 2887 | sizeh->min_height = sizeh->max_height = xw.fh; |
| 2888 | } | 2888 | } |
| 2889 | 2889 | ||
| 2890 | XSetWMProperties(xw.dpy, xw.win, NULL, NULL, NULL, 0, sizeh, &wm, &class); | 2890 | XSetWMProperties(xw.dpy, xw.win, NULL, NULL, NULL, 0, sizeh, &wm, |
| 2891 | &class); | ||
| 2891 | XFree(sizeh); | 2892 | XFree(sizeh); |
| 2892 | } | 2893 | } |
| 2893 | 2894 | ||
| @@ -3176,6 +3177,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3176 | if(base.fg == defaultfg) | 3177 | if(base.fg == defaultfg) |
| 3177 | base.fg = defaultunderline; | 3178 | base.fg = defaultunderline; |
| 3178 | } | 3179 | } |
| 3180 | |||
| 3179 | if(IS_TRUECOL(base.fg)) { | 3181 | if(IS_TRUECOL(base.fg)) { |
| 3180 | colfg.alpha = 0xffff; | 3182 | colfg.alpha = 0xffff; |
| 3181 | colfg.red = TRUERED(base.fg); | 3183 | colfg.red = TRUERED(base.fg); |
| @@ -3198,8 +3200,6 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3198 | bg = &dc.col[base.bg]; | 3200 | bg = &dc.col[base.bg]; |
| 3199 | } | 3201 | } |
| 3200 | 3202 | ||
| 3201 | |||
| 3202 | |||
| 3203 | if(base.mode & ATTR_BOLD) { | 3203 | if(base.mode & ATTR_BOLD) { |
| 3204 | if(BETWEEN(base.fg, 0, 7)) { | 3204 | if(BETWEEN(base.fg, 0, 7)) { |
| 3205 | /* basic system colors */ | 3205 | /* basic system colors */ |
| @@ -3229,7 +3229,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3229 | colfg.green = ~fg->color.green; | 3229 | colfg.green = ~fg->color.green; |
| 3230 | colfg.blue = ~fg->color.blue; | 3230 | colfg.blue = ~fg->color.blue; |
| 3231 | colfg.alpha = fg->color.alpha; | 3231 | colfg.alpha = fg->color.alpha; |
| 3232 | XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, &revfg); | 3232 | XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colfg, |
| 3233 | &revfg); | ||
| 3233 | fg = &revfg; | 3234 | fg = &revfg; |
| 3234 | } | 3235 | } |
| 3235 | 3236 | ||
| @@ -3240,7 +3241,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3240 | colbg.green = ~bg->color.green; | 3241 | colbg.green = ~bg->color.green; |
| 3241 | colbg.blue = ~bg->color.blue; | 3242 | colbg.blue = ~bg->color.blue; |
| 3242 | colbg.alpha = bg->color.alpha; | 3243 | colbg.alpha = bg->color.alpha; |
| 3243 | XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, &revbg); | 3244 | XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &colbg, |
| 3245 | &revbg); | ||
| 3244 | bg = &revbg; | 3246 | bg = &revbg; |
| 3245 | } | 3247 | } |
| 3246 | } | 3248 | } |
| @@ -3320,7 +3322,7 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3320 | u8fblen += u8cblen; | 3322 | u8fblen += u8cblen; |
| 3321 | } | 3323 | } |
| 3322 | if(doesexist) { | 3324 | if(doesexist) { |
| 3323 | if (oneatatime) | 3325 | if(oneatatime) |
| 3324 | continue; | 3326 | continue; |
| 3325 | break; | 3327 | break; |
| 3326 | } | 3328 | } |
| @@ -3343,6 +3345,8 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3343 | * Nothing was found in the cache. Now use | 3345 | * Nothing was found in the cache. Now use |
| 3344 | * some dozen of Fontconfig calls to get the | 3346 | * some dozen of Fontconfig calls to get the |
| 3345 | * font for one single character. | 3347 | * font for one single character. |
| 3348 | * | ||
| 3349 | * Xft and fontconfig are design failures. | ||
| 3346 | */ | 3350 | */ |
| 3347 | fcpattern = FcPatternDuplicate(font->pattern); | 3351 | fcpattern = FcPatternDuplicate(font->pattern); |
| 3348 | fccharset = FcCharSetCreate(); | 3352 | fccharset = FcCharSetCreate(); |
| @@ -3387,6 +3391,12 @@ xdraws(char *s, Glyph base, int x, int y, int charlen, int bytelen) { | |||
| 3387 | } | 3391 | } |
| 3388 | 3392 | ||
| 3389 | /* | 3393 | /* |
| 3394 | * This is how the loop above actually should be. Why does the | ||
| 3395 | * application have to care about font details? | ||
| 3396 | * | ||
| 3397 | * I have to repeat: Xft and Fontconfig are design failures. | ||
| 3398 | */ | ||
| 3399 | /* | ||
| 3390 | XftDrawStringUtf8(xw.draw, fg, font->set, winx, | 3400 | XftDrawStringUtf8(xw.draw, fg, font->set, winx, |
| 3391 | winy + font->ascent, (FcChar8 *)s, bytelen); | 3401 | winy + font->ascent, (FcChar8 *)s, bytelen); |
| 3392 | */ | 3402 | */ |
