Skip to content

Commit

Permalink
flush after ungrabbing server
Browse files Browse the repository at this point in the history
otherwise it could stay grabbed for longer than intended.

Fixes: #402
  • Loading branch information
N-R-K committed Mar 5, 2025
1 parent 6345b81 commit fd437b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/scrot_selection.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ Imlib_Image scrotSelectionSelectMode(void)
}

if (!success) {
if (opt.freeze)
if (opt.freeze) {
XUngrabServer(disp);
XFlush(disp);
}
return NULL;
}

Expand All @@ -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;
Expand Down

0 comments on commit fd437b3

Please sign in to comment.