How to tell when a Control becomes active?

Godot Version

v4.3.stable.official [77dcf97d8]

Question

I’m writing an editor plugin and have created several different dock windows. I’d like to know when the user switches from using one to the another. These controls have quite a few layers of child controls (buttons, labels, layout containers, some custom Controls). I’d like to have the root component know when the user has switched to using anything under it so that it can activate or deactivate certain things.

For example, I have a custom toolbar which I want to show as an overlay when the user is working in a window, but have it hide when they move to another window. I also want to redraw some graphics when the user switches back to using one of the windows. I’ve tried listening to the focus_entered signal, but this doesn’t seem to be getting called. I could try using the mouse_entered and mouse_exited signals, but the user is not necessarily moving between my windows using the mouse.

I know that there are a lot of editors that somehow ‘know’ which window you are working in and can activate or deactivate things based on that. Is there any way for the root of my dock window component to know when it is being used?