diff --git a/src/main.c b/src/main.c index 36143a2..cecc91d 100644 --- a/src/main.c +++ b/src/main.c @@ -32,6 +32,8 @@ #include #include #include +#include +#include /* Xlocale.h and locale.h are the same if X_LOCALE is undefind in wconfig.h, @@ -617,6 +619,16 @@ static int real_main(int argc, char **argv) { int i; + /* Block SIGUSR2 early so all threads (including library threads like + * pango's fontconfig thread) inherit the blocked mask. The signalfd + * in the Wayland event loop will be the sole recipient. */ + { + sigset_t ss; + sigemptyset(&ss); + sigaddset(&ss, SIGUSR2); + pthread_sigmask(SIG_BLOCK, &ss, NULL); + } + setlocale(LC_ALL, ""); wsetabort(wAbort);