From 71f4482f71799185650d7bf4c0695013a45613cc Mon Sep 17 00:00:00 2001 From: NRK Date: Wed, 5 Mar 2025 16:58:35 +0000 Subject: [PATCH] XSync after selection.destroy() not before 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: https://github.com/resurrecting-open-source-projects/scrot/issues/387 --- src/scrot_selection.c | 2 +- src/selection_classic.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/scrot_selection.c b/src/scrot_selection.c index 6ea8950..2431406 100644 --- a/src/scrot_selection.c +++ b/src/scrot_selection.c @@ -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 diff --git a/src/selection_classic.c b/src/selection_classic.c index 0a90dd2..a668bb2 100644 --- a/src/selection_classic.c +++ b/src/selection_classic.c @@ -99,6 +99,4 @@ void selectionClassicDestroy(void) if (pc->gc) XFreeGC(disp, pc->gc); - - XFlush(disp); }