Gizmos doesn't work correctly on multiple windows

So, I write an addon to paint a texture on a photoscanned objects. Currently it looks like that:


It works normally, but when multiple windows used, gizmos (small blue points on cameras) select doesn’t work.
Here is simplified version:
GizmoTest_2.81.blend (832.6 KB)

So what I missed?