This question is a particular case of the following:
I came up at the same solution in the following post, ignoring for a moment the real data of the problem, that is $X \sim U (-\pi ,\pi)$ and not $X \sim U ( -\pi/2 ,\pi/2)$.
Due to this change in the domain of $X$, I split the problem in 3 parts and summed up:
$P(-\pi/2 \le x \le \arctan(y)) +P(\pi/2 \le x \le \pi-\arctan(y)) +P(-\pi \le x \le - \pi + \arctan(y)) $
Is this approach correct?