Skip to content

Commit

Permalink
XSync after selection.destroy() not before
Browse files Browse the repository at this point in the history
removes XFlush from selectionClassicDestroy as it's now
redundant.

also changes discard argument to false, not sure why it was true
to begin with.

Maybe-fixes: #387
  • Loading branch information
N-R-K committed Mar 5, 2025
1 parent fd437b3 commit 71f4482
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion src/scrot_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ static void scrotSelectionDestroy(void)
{
XUngrabPointer(disp, CurrentTime);
freeCursors();
XSync(disp, True);
selection.destroy();
XSync(disp, False);
/* HACK: although we destroyed the selection, the frame still might not
* have been updated. a compositor might also buffer frames adding
* latency. so wait a bit for the screen to update and the selection
Expand Down
2 changes: 0 additions & 2 deletions src/selection_classic.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,4 @@ void selectionClassicDestroy(void)

if (pc->gc)
XFreeGC(disp, pc->gc);

XFlush(disp);
}

0 comments on commit 71f4482

Please sign in to comment.