scrot icon indicating copy to clipboard operation
scrot copied to clipboard

fix: incorrect line opacity mapping

Open N-R-K opened this issue 2 years ago • 7 comments
trafficstars

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

N-R-K avatar May 18 '23 09:05 N-R-K

It should fix the issue, but some actual real-world testing is still needed.

N-R-K avatar May 18 '23 09:05 N-R-K

The opacity setting doesn't seem to work in general:

scrot -s -l width=4,opacity=1

I see no difference between master and this PR, both are broken, the line isn't transparent at all, it does blend oddly with whatever is under it however.

Why not just remove it since nobody complained about it not working in all this time?

guijan avatar May 21 '23 14:05 guijan

The opacity setting doesn't seem to work in general:

Are you running under a compositor that supports _NET_WM_WINDOW_OPACITY?

https://github.com/resurrecting-open-source-projects/scrot/blob/6e2b5221bc25bb073552a2b0707ee99803f1a44f/man/scrot.txt#L163-L164

since nobody complained about it not working in all this time?

It seems to be working fine (except the 100 vs 255 part) for the person that opened the bug report https://github.com/resurrecting-open-source-projects/scrot/issues/281:

Instead, opacity=255 is slightly see through, but opacity=100 is completely opaque.

N-R-K avatar May 21 '23 14:05 N-R-K

I'm running xcompmgr, seems it doesn't. picom (a fork of xcompmgr) also doesn't it seems.

guijan avatar May 21 '23 15:05 guijan

Should probably document that it can't be any compositor, too.

guijan avatar May 21 '23 17:05 guijan

picom (a fork of xcompmgr) also doesn't it seems

What WM were you running? Perhaps this flag makes it work?

https://github.com/yshui/picom/blob/3aed5599c3f73cbfa53b0249795e76ab07cf9ecd/man/picom.1.asciidoc?plain=1#L130C1-L131

N-R-K avatar May 22 '23 18:05 N-R-K

spectrwm. Still doesn't work with that flag.

guijan avatar May 22 '23 18:05 guijan

If no one can test this, I'll just merge it in a day or two, since the math adds up.

N-R-K avatar May 24 '24 17:05 N-R-K