resurrecting-open-source-projects / scrot

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

Border color is distorted with classic mode #379

Open N-R-K opened 4 months ago

N-R-K commented 4 months ago

For testing I was using the following to select a video playing on firefox:

$ ./scrot -s -lmode=classic,width=8,color=#ff3838

When the border was over the playing video, the color was completely distorted. I also noticed this happen when the border was above an xterm window's "selected" region. It was almost as if the border color is being blended with the background color.

edge mode doesn't seem to have this problem.

daltomi commented 4 months ago

edge mode doesn't seem to have this problem.

Yes because edge is a real shaped window, while classic mode is pixel logical operation(GXxor) on root GC (It was always the way scrot worked)

The first draw clears the previous, the second draws.

https://github.com/resurrecting-open-source-projects/scrot/blob/d01587d4eeab53dae56cd1a0acc027d26a93884a/src/selection_classic.c#L92-L95

The possible solution would be to remove the following lines and leave the black and white originally and warn the user that the color is only for edge mode https://github.com/resurrecting-open-source-projects/scrot/blob/d01587d4eeab53dae56cd1a0acc027d26a93884a/src/selection_classic.c#L60-L64

Ref: de9e67f ("Allow to change the color to the line style.", 2019-08-19)