From c3098fe861ad9af290c67f05eab7e0928ec2d512 Mon Sep 17 00:00:00 2001 From: NRK Date: Tue, 4 Mar 2025 21:26:36 +0000 Subject: [PATCH] flush after ungrabbing server otherwise it could stay grabbed for longer than intended. Fixes: https://github.com/resurrecting-open-source-projects/scrot/issues/402 --- src/scrot_selection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/scrot_selection.c b/src/scrot_selection.c index 1bb55db..6ea8950 100644 --- a/src/scrot_selection.c +++ b/src/scrot_selection.c @@ -437,8 +437,10 @@ Imlib_Image scrotSelectionSelectMode(void) } if (!success) { - if (opt.freeze) + if (opt.freeze) { XUngrabServer(disp); + XFlush(disp); + } return NULL; } @@ -451,8 +453,10 @@ Imlib_Image scrotSelectionSelectMode(void) Imlib_Image capture = scrotGrabRectAndPointer( rect0.x, rect0.y, rect0.w, rect0.h, opt.freeze); - if (opt.freeze) + if (opt.freeze) { XUngrabServer(disp); + XFlush(disp); + } if (opt.selection.mode == SELECTION_MODE_CAPTURE) return capture;