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

scrot --select borders caught up in the screenshot #284

Closed
guijan opened this issue May 4, 2023 · 3 comments · Fixed by #378
Closed

scrot --select borders caught up in the screenshot #284

guijan opened this issue May 4, 2023 · 3 comments · Fixed by #378
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@guijan
Copy link
Contributor

guijan commented May 4, 2023

Someone made a Youtube video about scrot and described a bug in it:
https://yewtu.be/watch?v=aD17Rd2D27c&t=250
The gist of it is that scrot --select (which implicitly means scrot --select --line mode=classic) seems to have a bug when selecting a video that is currently being played, the selection edges lag behind. Then, when you finally take the screenshot, those edges can be caught by the screenshot.

We could simply make --line mode=edge the default and deprecate --line mode=classic to fix this. However, it would also be wise to figure out why this bug is there. It would also be wise to figure out which option is "better" and deprecate the other, maybe edge is not better. Also, the man page says edge and classic support different but overlapping customization options, so the missing functionality should be added to one or the other.

@guijan guijan changed the title scrot --select bugs scrot --select borders caught up in the screenshot May 4, 2023
@guijan guijan changed the title scrot --select borders caught up in the screenshot scrot --select borders caught up in the screenshot May 4, 2023
@N-R-K
Copy link
Collaborator

N-R-K commented May 4, 2023

According to the FAQ the edge mode doesn't work properly when a compositor is running.

scrot/FAQ

Lines 30 to 32 in 80660e7

Or using another selection mode: scrot --select --line mode=edge
But this last one does not behave correctly with some
CWM (Composite Window Manager)

@N-R-K
Copy link
Collaborator

N-R-K commented May 7, 2023

I was trying to look at what slop does in it's pure X implementation and found this comment

# This should really never be disabled. The pure-X mode of slop is very expensive and buggy.
# It also doesn't work on Wayland. Though if a system is never running a compositor, or
# doesn't have OpenGL, this could remove some linking dependencies I suppose.

So it seems like even slop (running in pure X mode) has issues when there's a compositor running.

If I get around setting up a compositor to test things out then I can probably try and see what's going on. Whatever it is, I suspect it should be possible to fix (since it apparently works fine with opengl), but I don't suspect it to be easy at all.

N-R-K added a commit to N-R-K/scrot that referenced this issue May 21, 2023
* xeventUnmap() did not check the union type before reading from it.
* unmap event should always come, no need to sleep/retry 30 times.
* remove xeventUnmap() and waitUnmapWindowNotify() entirely. the main
  logic is short enough to inline directly at the call site.
* rather than unmapping the window, and then destroying it, destroy it
  directly and wait for the DestroyNotify event. (this may help with:
  resurrecting-open-source-projects#284)
* compare window ID against `None` rather than `0`. no functional
  difference, but using `None` is more idiomatic for X11 things.
@N-R-K N-R-K added bug Something isn't working help wanted Extra attention is needed labels May 27, 2023
N-R-K added a commit to N-R-K/scrot that referenced this issue Jun 11, 2023
if no compositor is running, use the "edge" mode since it has less
issues compared to the classic mode.

ref: resurrecting-open-source-projects#284
N-R-K added a commit to N-R-K/scrot that referenced this issue Jun 11, 2023
if no compositor is running, use the "edge" mode since it has less
issues compared to the classic mode.

ref: resurrecting-open-source-projects#284
N-R-K added a commit to N-R-K/scrot that referenced this issue Jun 11, 2023
if no compositor is running, use the "edge" mode since it has less
issues compared to the classic mode.

ref: resurrecting-open-source-projects#284
@N-R-K N-R-K closed this as completed in a9b717f Jun 11, 2023
@N-R-K
Copy link
Collaborator

N-R-K commented Jun 11, 2023

Closed this since the default is now edge when no compositor is running. The issues with compositor is tracked in #76.

N-R-K added a commit to N-R-K/scrot that referenced this issue May 29, 2024
selection classic is still the default for many people who are
using a compositor. adding a hacky sleep similar to selection
edge seems to fix it on my end.

Fixes: resurrecting-open-source-projects#284
N-R-K added a commit that referenced this issue May 31, 2024
selection classic is still the default for many people who are
using a compositor. adding a hacky sleep similar to selection
edge seems to fix it on my end.

Fixes: #284
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants