xft crash workaround, only useful for debian/other distros that run an

ancient libxft version
This commit is contained in:
speedie 2023-05-03 21:38:34 +02:00
parent a2257f2503
commit 393c24af3c

View file

@ -340,9 +340,17 @@ drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int
XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w - 1, h - 1);
}
int
xerrordummy(Display *dpy, XErrorEvent *ee)
{
return 0;
}
int
drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, Bool markup)
{
XSetErrorHandler(xerrordummy);
#if USEPANGO // pango
char buf[1024];
int ty;
@ -523,8 +531,12 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
if (d)
XftDrawDestroy(d);
XSync(drw->dpy, False);
return x + (render ? w : 0);
#endif
XSync(drw->dpy, False);
}
void