/* Move first to second. */
result &= _con_move_to_con(first, second, false, false, false, true, false);
+ /* If swapping the containers didn't work we don't need to mess with the focus. */
+ if (!result) {
+ goto swap_end;
+ }
/* If we moved the container holding the focused window to another
* workspace we need to ensure the visible workspace has the focused
/* Move second to where first has been originally. */
result &= _con_move_to_con(second, fake, false, false, false, true, false);
-
- /* If swapping the containers didn't work we don't need to mess with the focus. */
if (!result) {
goto swap_end;
}