Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selection tool leaves rectangle trails #74

Closed
phord opened this issue Mar 21, 2021 · 11 comments
Closed

selection tool leaves rectangle trails #74

phord opened this issue Mar 21, 2021 · 11 comments

Comments

@phord
Copy link

phord commented Mar 21, 2021

First time using scrot. I built it from master and tried it for the first time. I used the --select option.

Mouse changed to crosshair cursor. I clicked and dragged to define a region to capture. As I did, the bounding box left behind trails where it did not erase cleanly. These were captured in the screenshot that was saved, as well.

I tried building earlier versions (back to 0.9) and the bug exists in every version tried. It also exists in the distro version (1.2) installed with apt.

Linux Mint 20.1 MATE (Gnome2) w/ marco compositor, 4k monitors

I've seen this exact sort of bug before. It's usually caused by "erasing" a rectangle at a different size than was originally drawn.

Seems weird if I'm the only one seeing it, so I suspect some unusual graphics config is interacting poorly.

2021-03-20-180900_865x604_scrot

@phord
Copy link
Author

phord commented Mar 21, 2021

Similar to what was reported here, though the issue is more dramatic for me.

Oh, bleh -- this is because scrot draws directly to the x buffers and the system is drawing to them at the same time? Lame. Using --freeze fixes the problem. But it shouldn't be happening anyway by default.

Probably --select should not draw on a "live" display buffer at all.

Similar / related to dreamer/scrot#2, probably.

@daltomi
Copy link
Collaborator

daltomi commented Mar 21, 2021

Hi
Try:
scrot --select --line mode=edge

Related #36

@phord
Copy link
Author

phord commented Mar 21, 2021

Thanks, @daltomi . I just stumbled across that in the code. Not sure why I didn't see when I scanned closed issues earlier.

I find mode=edge to be buggy as well. For some reason it leaves a preliminary rectangle on the screen in the top left corner of the capture.
2021-03-20-192513_331x86_scrot

@daltomi
Copy link
Collaborator

daltomi commented Mar 21, 2021

Does it only happen when you drag and drop very fast or always?

@phord
Copy link
Author

phord commented Mar 21, 2021

Always, even if I click without moving the cursor at all, then move it several seconds later to create a non-zero sized rectangle. In this case the dropped rectangle is small (1/4 size of a letter on my screen). If I click and drag quickly the rectangle is larger.

@phord
Copy link
Author

phord commented Mar 21, 2021

Sometimes the rectangle is in the captured region, but sometimes it is not.
2021-03-20-201300_135x96_scrot

@daltomi
Copy link
Collaborator

daltomi commented Mar 21, 2021

I still do not know if it's a new bug or it's the one I have and I'm trying to solve.
If you can test the PR #75

@daltomi
Copy link
Collaborator

daltomi commented Mar 21, 2021

I just installed Mate and I was able to observe the fault indicating.
I'll look.

@daltomi
Copy link
Collaborator

daltomi commented Mar 21, 2021

Hi @phord
I opened a new Issue #76 for the problem of MATE and I close this one that partially solves it with: scrot --select --freeze

@daltomi daltomi closed this as completed Mar 21, 2021
@phord
Copy link
Author

phord commented Mar 21, 2021

Thanks for looking into this. I was planning to explore it some myself, but I don't know how much time I'll have to play with scrot in the end.

@phord
Copy link
Author

phord commented Mar 21, 2021

I do think the original problem (fixed by freeze) should be properly fixed so freeze is no longer necessary. A happy medium might be too make freeze the default mode.

rarescosma added a commit to rarescosma/env.dotfiles that referenced this issue Sep 12, 2024
People have had limited success with the '--freeze' option of scrot,
see resurrecting-open-source-projects/scrot#74

But we also run unclutter which hides the mouse cursor and '--freeze'
keeps it hidden. Kinda hard to do selections with an invisible cursor,
so added a fugly hack to artifically move the mouse right before the
scrot invokation.
schuam added a commit to schuam/dms that referenced this issue Mar 9, 2025
Somehow when I tried to take screen shots with the select option, a lot
of times I ended up with black rectangles in the screenshot the `-f`
options prevents this.

See resurrecting-open-source-projects/scrot#74
for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants