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.
This commit is contained in:
step 2022-09-24 10:40:33 +02:00 committed by GitHub
parent 34cd955f14
commit 499b7fbc19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 0 deletions

View File

@ -62,7 +62,21 @@ reload_config(int sig)
config_init(dpy); config_init(dpy);
xloadcols(); xloadcols();
/* nearly like zoomabs() */
xunloadfonts();
xloadfonts(font, 0); /* font <- config_init() */
#if FONT2_PATCH
xloadsparefonts();
#endif // FONT2_PATCH
cresize(0, 0);
redraw(); redraw();
xhints();
XCloseDisplay(dpy); 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 #endif // XRESOURCES_RELOAD_PATCH