From 95350f6f67a629f5cbcbb5c16306e2d093a633ae Mon Sep 17 00:00:00 2001 From: NRK Date: Thu, 18 May 2023 15:43:18 +0600 Subject: [PATCH] fix: incorrect line opacity mapping current code treats opacity as [0, 100] even though the manpage documents it as being [0, 255]. Fixes: https://github.com/resurrecting-open-source-projects/scrot/issues/281 --- src/selection_edge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selection_edge.c b/src/selection_edge.c index b4d11a2..d5b5976 100644 --- a/src/selection_edge.c +++ b/src/selection_edge.c @@ -61,7 +61,7 @@ void selectionEdgeCreate(void) HeightOfScreen(scr), 0, CopyFromParent, InputOutput, CopyFromParent, CWOverrideRedirect | CWBackPixel, &attr); - unsigned long opacity = opt.lineOpacity * ((unsigned)-1 / 100); + unsigned long opacity = opt.lineOpacity * (0xFFFFFFFFu / 255); XChangeProperty(disp, pe->wndDraw, XInternAtom(disp, "_NET_WM_WINDOW_OPACITY", False), XA_CARDINAL, 32,