scrot icon indicating copy to clipboard operation
scrot copied to clipboard

scrot -s sometimes captures the white rectangle used when marking an area

Open Ploppz opened this issue 11 years ago • 31 comments

Example: http://imgur.com/yH7IwhX here you see a white line on the top and a bit at the left. Happens frequently.

Ploppz avatar Apr 26 '14 14:04 Ploppz

I think this happens because of a redraw on the underlaying window (e.g. Chrome's PDF viewer while hiding its tooolbar). Thus it's more of an X-Server issue rather than a scrot one (I took a quick look through the code for snapping a section of the screen).

michaelneu avatar Jan 26 '16 10:01 michaelneu

I changed the source code (line 275 at main.c) to the following:

/* move rectangle out of screenshot area */  
rect_x = rx -1;  
rect_y = ry -1;  
rect_w = ev.xmotion.x - rect_x +1;  
rect_h = ev.xmotion.y - rect_y +1;

Maybe not the best solution, but it's fine for me. Screenshot with official version: old

Screenshot with my version: new

0x483d avatar Apr 14 '17 10:04 0x483d

I get the same issue, where of course the line is black instead of white.

aphirst avatar Aug 10 '17 14:08 aphirst

See escrotum, slop and maim: https://wiki.archlinux.org/index.php/taking_a_screenshot#scrot

Beep6581 avatar Jan 08 '18 10:01 Beep6581

Escrotum is bloated and by definition written on python which is not really a good idea. But at least it has no bug

ghost avatar Feb 10 '18 14:02 ghost

Same issue here on Debian Buster. @njx4 you seem to have solved that issue with your code. Could you please submit a PR?

MaBeuLux88 avatar Oct 08 '18 16:10 MaBeuLux88

+1 have the black top-left border on every single sscreenshot I take with scrot -s on Arch Linux repo scrot; compton and i3.

s-ol avatar Oct 18 '18 03:10 s-ol

+1 Same issue here on both ubuntu and arch linux. compton and i3 as in the case of previous user. I killed compton and the issue was solved, but I need compton because of tearing issues. So, does it need to be solved from compton side or scrot?

SandroJijavadze avatar Nov 15 '18 08:11 SandroJijavadze

How can i add njx's changes to my scrot and recompile?

mindmusclevegan avatar Jan 13 '19 23:01 mindmusclevegan

@mindmusclevegan Apply the patch, then ./configure --prefix="$PWD/build" && make or similar. You can run it from src/scrot then or make install (will be installed in build with the above prefix). But that's rather off-topic.

blueyed avatar Jan 16 '19 11:01 blueyed

I've found that there is code that is supposed to clear the rectangle already: https://github.com/dreamer/scrot/blob/974fc6b77af4abdec59568efa3e4ff57dae15453/src/main.c#L347-L350

But I've also noticed that the rectangle itself does not behave well over a (changing) urxvt window, and when using a composite manager (compton).

blueyed avatar Jan 16 '19 11:01 blueyed

Can confirm, this is still happening on Arch Linux.

$ scrot --version
scrot version 0.8

MrAwesome avatar May 17 '19 14:05 MrAwesome

Same issue with:

$ scrot --version
scrot version 0.8
$ i3 --version
i3 version 4.16.1 (2019-01-27) © 2009 Michael Stapelberg and contributors
$ compton --version
v6.2
$ uname -a
Linux 5.1.5-arch1-2-ARCH #1 SMP PREEMPT Mon May 27 03:37:39 UTC 2019 x86_64 GNU/Linux

agherzan avatar Jun 07 '19 10:06 agherzan

Hi all. If you want, you can participate in scrot that is still in development. Please, see the ChangeLog.

This specific bug is not seen, but you can use the new option --freeze, otherwise open a new issue.

For ArchLinux: it is expected that scrot is in the testing branch of Debian, now it is in experimental.

Regards.

ghost avatar Jun 15 '19 16:06 ghost

it always does that if something updates on the screen while you are selecting something

ano0 avatar Jul 08 '19 11:07 ano0

Just switched to maim because of this.

nhap69 avatar Aug 05 '19 03:08 nhap69

You can use scrot -a $(slop -f '%x,%y,%w,%h') instead of scrot -s

GoldsteinE avatar Aug 16 '19 10:08 GoldsteinE

@GoldsteinE Are you using a different version of scrot? I don't see -a as an option in scrot 0.8.

Etherealflux avatar Oct 02 '19 15:10 Etherealflux

@Etherealflux

@GoldsteinE Are you using a different version of scrot? I don't see -a as an option in scrot 0.8.

$ scrot --version
scrot version 1.2

GoldsteinE avatar Oct 02 '19 15:10 GoldsteinE

Thanks. This repo must be out of date, then, since I did try building it from source first. I'll look into that more later!

Etherealflux avatar Oct 02 '19 17:10 Etherealflux

Ehh, it seems I must start actually maintaining this repo again… FYI for all readers: I am not the original author of scrot - only the first person to recover the code from defunct page of an original author and upload it to GitHub. I implemented the feature I needed at the time and that's it.

Last time I checked, all the distributions carry their own version/fork of scrot, so this project does not have one single upstream source.

dreamer avatar Oct 02 '19 18:10 dreamer

@GoldsteinE solution worked for me Arch linux, i3wm, compton, scrot + slop from official arch repo

SuddenGunter avatar Dec 05 '19 22:12 SuddenGunter

Same issue, version 1.3 @GoldsteinE solution works for me

lucasvazq avatar Aug 16 '20 04:08 lucasvazq

In my experience, adding -f (freeze) flag circumvents the bug.

scrot -sf

jsamr avatar Mar 10 '21 13:03 jsamr

I moved on to Flameshot which has a lot more features and stays lightweight and very simple to use.

MaBeuLux88 avatar Mar 10 '21 13:03 MaBeuLux88

can confirm. Still happening on Arch Linux BSPWM + Picom

ilhamisbored avatar Oct 31 '21 03:10 ilhamisbored

I can confirm, this also happening on Void Linux what makes it worse and unusable showing outlines: https://i.imgur.com/xWnOj3d.png

with the --freeze option, scrot -fs filename.png fix this issue.

gutfacehubook avatar May 10 '22 11:05 gutfacehubook

It seems that using slop is a better option for me. I've been using scrot -s -f inside EXWM for a while to get rid of the white lines, but recently that renders my Chrome page to be a white blank if I don't select fast enough. scrot -a $(slop -f '%x,%y,%w,%h') as @GoldsteinE suggested works fine.

ChenSun-Phys avatar Jan 25 '23 22:01 ChenSun-Phys

Confirmed this issue still exists on void linux with scrot-1.10_1.x86_64-musl test_000

mikedesu avatar Dec 12 '23 17:12 mikedesu

Confirmed this issue still exists on void linux with scrot-1.10_1.x86_64-musl test_000

A good solution is to use -f to freeze the screen. This solves the problem for now

mikedesu avatar Dec 14 '23 02:12 mikedesu