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

fix racy --freeze behavior #382

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

N-R-K
Copy link
Collaborator

@N-R-K N-R-K commented Jun 24, 2024

this patch makes a couple different changes:

  • previously the grab/ungrab was happening inside of selection_classic::{create,destroy}. this meant that --freeze was ineffective when edge mode was used. the patch moves those calls outside of it, so that --freeze can work on edge mode as well.
  • because the grab/ungrab was happening inside selection destroy, there were multiple races. one of them was that the server would be ungrabbed after selection was done but before the shot was captured. the sleep introduced in commit 93e475d widened the race window and made it more easily noticeable. the patch makes it so that we don't ungrab the server until the shot is actually taken.

Fixes: #381

this patch makes a couple different changes:

* previously the grab/ungrab was happening inside of
  selection_classic::{create,destroy}. this meant that
  `--freeze` was ineffective when edge mode was used.
  the patch moves those calls outside of it, so that `--freeze`
  can work on edge mode as well.
* because the grab/ungrab was happening inside selection
  destroy, there were multiple races. one of them was that the
  server would be ungrabbed after selection was done but
  *before* the shot was captured. the sleep introduced in commit
  93e475d widened the race window and made it more easily
  noticeable. the patch makes it so that we don't ungrab the
  server until the shot is actually taken.

Fixes: resurrecting-open-source-projects#381
@N-R-K N-R-K added the bug Something isn't working label Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Content captured by scrot -f -s differs from the content that is frozen on.
1 participant