resurrecting-open-source-projects / scrot

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

set blending option once, before the loop #349

Closed N-R-K closed 1 year ago

N-R-K commented 1 year ago

instead of setting them everytime in the loop, it's sufficient to set it just once before entering the loop.

also remove imlib_context_set_angle() since that is a text related setting and has no effect on imlib_blend_image_onto_image().

N-R-K commented 1 year ago

remove imlib_context_set_angle() since that is a text related setting

I noticed this when trying to link against imlib2 built with --disable-text and saw the error:

src/scrot.c:1016: undefined reference to `imlib_context_set_angle'

This was on a local branch with scrot's --notes feature removed.


Everything should still work fine, I think. But I do not use a compositor so I could not test, since -k requires compositor.

If someone can test and confirm everything to be working, then I can merge this.

N-R-K commented 1 year ago

I just removed this check and tried scrot -k and everything worked perfectly fine without running any compositor.

https://github.com/resurrecting-open-source-projects/scrot/blob/5c2d6afe801ee36d0744e6e89c2cf4f8156dcff1/src/scrot.c#L832-L836

I don't think a compositor is needed for -k since we redirect all the sub-windows manually here:

https://github.com/resurrecting-open-source-projects/scrot/blob/5c2d6afe801ee36d0744e6e89c2cf4f8156dcff1/src/scrot.c#L866


Here's the resulting screenshot:

scrot

N-R-K commented 1 year ago

Tested this PR with that check removed and everything seems to be working fine.


Also opened a new PR for removing the compositor check: #354. So let's move any discussion about that over to the new PR.