From 05871c1a5f0d899794d6215c393e96fd592a42d8 Mon Sep 17 00:00:00 2001 From: Jake Koroman Date: Tue, 4 Nov 2025 20:33:32 -0500 Subject: x.c: make opacity toggleable. --- x.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'x.c') diff --git a/x.c b/x.c index 881bba6..5e4fc91 100644 --- a/x.c +++ b/x.c @@ -55,6 +55,7 @@ static void clipcopy(const Arg *); static void clippaste(const Arg *); static void numlock(const Arg *); static void selpaste(const Arg *); +static void togglealpha(const Arg *); static void zoom(const Arg *); static void zoomabs(const Arg *); static void zoomreset(const Arg *); @@ -281,6 +282,15 @@ clippaste(const Arg *dummy) xw.win, CurrentTime); } +void +togglealpha(const Arg *dummy) +{ + alpha = alpha != 1.0f ? 1.0f : DEFAULT_ALPHA; + dc.col[defaultbg].color.alpha = (unsigned short)(0xFFFF * alpha); + cresize(0, 0); + redraw(); +} + void selpaste(const Arg *dummy) { -- cgit v1.2.3