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.
this patch makes a couple different changes:
--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.Fixes: https://github.com/resurrecting-open-source-projects/scrot/issues/381