From 4b586a14bd553559153e717955b35cf07a8d52cb Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 13 Oct 2024 01:33:33 +0900 Subject: Init --- st/x.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'st/x.c') diff --git a/st/x.c b/st/x.c index 3c1c242..6856e48 100644 --- a/st/x.c +++ b/st/x.c @@ -323,7 +323,9 @@ void changealpha(const Arg *arg) { if((alpha > 0 && arg->f < 0) || (alpha < 1 && arg->f > 0)) - alpha += arg->f; + alpha += arg->f; + else if (arg->f == 0.0f) + alpha = alpha_def; alpha = clamp(alpha, 0.0, 1.0); alphaUnfocus = clamp(alpha-alphaOffset, 0.0, 1.0); @@ -1331,10 +1333,12 @@ xinit(int cols, int rows) xloadfonts(usedfont, 0); } - /* spare fonts */ xloadsparefonts(); + /* Backup default alpha value */ + alpha_def = alpha; + /* colors */ xw.cmap = XCreateColormap(xw.dpy, parent, xw.vis, None); xloadcols(); -- cgit v1.2.3