[Solved] ViewItemIndex is -1 in NewImageViewerControlEvent on a live camera view

On a customer setup our plugin behaves differently than any other deployments so far.

We use the NewImageViewerControlEvent to capture the ImageViewerAddOn and subscribe to its ImageDisplayedEvent so we can draw on it.

In this particular setup, when the user switches to a different tab and comes back to the “Views” tab, the ImageViewerAddOn.ViewItemIndex of all the visible cameras is -1.

If we switch between preconfigured views (from the left menu) or drag a camera into one view, the ViewItemIndex is correct and all works as expected.

According to the documentation, -1 means that it’s not a camera and we skip this viewer. If we don’t skip it, then things get even worse when opening the Search. That’s because the recording view was always returning -1 and now our plugin would render also there. Additionally, the close event is not triggered for the event view, and that causes other issues.

Any idea on what is the reason for the ViewItemIndex being -1?

Thanks

Solved. It was due to patches on the 2023 R2 not being installed for the Smart Client.