Skip to content

Crash DWM Youtube

Introduccion

Cuando se ven videos de youtube, dwm se cae, es posible que existan unos problemas con los simbolos de graficos animados o emojis en la barra del titulo.

Entonces, lo que se propone es corregirlo agregando un control en el metodo xerror de dwm.c

Terminal window
--- a/dwm.c
+++ b/dwm.c
_AT_@ -2081,6 +2081,13 @@ wintomon(Window w)
int
xerror(Display *dpy, XErrorEvent *ee)
{
+ /* FIXME: avoid crashing because of big glyphs (emojis) that dont fit
+ * title bar */
+ int opcode, event, error;
+ if (XQueryExtension(dpy, "RENDER", &opcode, &event, &error)
+ || (ee->request_code == opcode && ee->error_code == BadLength))
+ return 0;
+
if (ee->error_code == BadWindow
|| (ee->request_code == X_SetInputFocus && ee->error_code == BadMatch)
|| (ee->request_code == X_PolyText8 && ee->error_code == BadDrawable)

Se agregan las lineas que tienen el simobolo +

Claude.ai. No Recomendado

Esto destruye las dependencias en PopOs el eliminar la xft. Sin embargo, si no eliminamos la xft, al parecer funciona.

Tenemos que ver que se puede haber rompido en Gnome Window Manager o los otros :)

Remover la libreria xft

Terminal window
sudo apt remove libxft2

Instalar dependencias

Terminal window
sudo apt install git build-essential autoconf automake libtool xorg-dev libfreetype6-dev libfontconfig1-dev xutils-dev

Compilar la libreria

Terminal window
git clone https://github.com/uditkarode/libxft-bgra
cd libxft-bgra
sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
make
sudo make install

Actualizar el config.mk de dwm

Terminal window
X11INC = /usr/include/X11
X11LIB = /usr/lib/X11

Compilar y reiniciar dwm

Resultado de la compilacion

make[2]: Entering directory '/home/goviedo/tmp/libxft-bgra/src'
/usr/bin/mkdir -p '/usr/lib'
/bin/bash ../libtool --mode=install /usr/bin/install -c libXft.la '/usr/lib'
libtool: install: /usr/bin/install -c .libs/libXft.so.2.3.3 /usr/lib/libXft.so.2.3.3
libtool: install: (cd /usr/lib && { ln -s -f libXft.so.2.3.3 libXft.so.2 || { rm -f libXft.so.2 && ln -s libXft.so.2.3.3 libXft.so.2; }; })
libtool: install: (cd /usr/lib && { ln -s -f libXft.so.2.3.3 libXft.so || { rm -f libXft.so && ln -s libXft.so.2.3.3 libXft.so; }; })
libtool: install: /usr/bin/install -c .libs/libXft.lai /usr/lib/libXft.la
libtool: install: /usr/bin/install -c .libs/libXft.a /usr/lib/libXft.a
libtool: install: chmod 644 /usr/lib/libXft.a
libtool: install: ranlib /usr/lib/libXft.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/sbin" ldconfig -n /usr/lib
----------------------------------------------------------------------
Libraries have been installed in:
/usr/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
- add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
during execution
- add LIBDIR to the 'LD_RUN_PATH' environment variable
during linking
- use the '-Wl,-rpath -Wl,LIBDIR' linker flag
- have your system administrator add LIBDIR to '/etc/ld.so.conf'
See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/mkdir -p '/usr/include/X11/Xft'
/usr/bin/install -c -m 644 ../include/X11/Xft/Xft.h ../include/X11/Xft/XftCompat.h '/usr/include/X11/Xft'
make[2]: Leaving directory '/home/goviedo/tmp/libxft-bgra/src'
make[1]: Leaving directory '/home/goviedo/tmp/libxft-bgra/src'
make[1]: Entering directory '/home/goviedo/tmp/libxft-bgra'
make[2]: Entering directory '/home/goviedo/tmp/libxft-bgra'
make[2]: Nothing to be done for 'install-exec-am'.
/usr/bin/mkdir -p '/usr/lib/pkgconfig'
/usr/bin/install -c -m 644 xft.pc '/usr/lib/pkgconfig'
make[2]: Leaving directory '/home/goviedo/tmp/libxft-bgra'
make[1]: Leaving directory '/home/goviedo/tmp/libxft-bgra

Links

https://lists.suckless.org/dev/1802/32534.html