How can I block signals coming from the program and not from user
interaction?