resurrecting-open-source-projects / scrot

SCReenshOT - command line screen capture utility
Other
495 stars 49 forks source link

fix: incorrect line opacity mapping #296

Closed N-R-K closed 4 months ago

N-R-K commented 1 year ago

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 commented 1 year ago

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

guijan commented 1 year ago

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?

N-R-K commented 1 year ago

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.

guijan commented 1 year ago

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

guijan commented 1 year ago

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

N-R-K commented 1 year ago

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

guijan commented 1 year ago

spectrwm. Still doesn't work with that flag.

N-R-K commented 4 months ago

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