From 499b7fbc195c7b6eac2bd383f243695550a440b0 Mon Sep 17 00:00:00 2001 From: step Date: Sat, 24 Sep 2022 10:40:33 +0200 Subject: [PATCH] XRESOURCES_RELOAD_PATCH reload fonts + re-render (#84) This patch 1) improves reloading X resources - by considering fonts in a way nearly identical to function `zoomabs`' - and 2) re-renders st so that changed colors and fonts can be seen. --- patch/xresources.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/patch/xresources.c b/patch/xresources.c index 9e72736..ba3d985 100644 --- a/patch/xresources.c +++ b/patch/xresources.c @@ -62,7 +62,21 @@ reload_config(int sig) config_init(dpy); xloadcols(); + + /* nearly like zoomabs() */ + xunloadfonts(); + xloadfonts(font, 0); /* font <- config_init() */ + #if FONT2_PATCH + xloadsparefonts(); + #endif // FONT2_PATCH + cresize(0, 0); redraw(); + xhints(); + XCloseDisplay(dpy); + + /* from https://st.suckless.org/patches/xresources-with-reload-signal */ + /* triggers re-render if we're visible */ + ttywrite("\033[O", 3, 1); } #endif // XRESOURCES_RELOAD_PATCH