Fix control panel search focus issue - SL #3188

Check if the window is active.

Fixes #3188

Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>