You can run a python script to track the focused window every few seconds to identify what’s stealing focus.