Skip to content

Add device iterator to ImGui ID stack for device selection pop up in RealSense Viewer#11221

Merged
Nir-Az merged 1 commit intorealsenseai:developmentfrom
martinseilerameria:device_selection_fix_realsense_viewer
Jan 10, 2023
Merged

Add device iterator to ImGui ID stack for device selection pop up in RealSense Viewer#11221
Nir-Az merged 1 commit intorealsenseai:developmentfrom
martinseilerameria:device_selection_fix_realsense_viewer

Conversation

@martinseilerameria
Copy link
Contributor

@martinseilerameria martinseilerameria commented Dec 15, 2022

There is a bug in the device selection pop up in RealSense Viewer.

To reproduce:

  1. Connect two or more cameras of the same model
  2. Open RealSenseViewer
  3. Close the default camera
  4. Click on the "Add Source" button
  5. Select the second (or third, fourth, ...) camera in the list -> nothing happens

Problem:
The ID of the ImGui::Selectable is based on the label, which in this case is the device name, which is the same for each camera.
Therefore, there will be an ID conflict and only the first Selectable is working.

Solution:
The problem is solved by adding a unique identifier to the ImGui ID Stack. In the proposed solution this unique identifier is the index of the device in the device_names vector.

@Nir-Az Nir-Az closed this Dec 18, 2022
@Nir-Az Nir-Az reopened this Dec 18, 2022
@Nir-Az
Copy link
Collaborator

Nir-Az commented Dec 18, 2022

@martinseilerameria Thanks for the fix,
We will try to reproduce and verify it.

@Nir-Az Nir-Az requested review from Nir-Az and noacoohen December 18, 2022 20:53
Copy link
Contributor

@noacoohen noacoohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, we added your commit.

@Nir-Az Nir-Az removed their request for review January 10, 2023 09:30
@Nir-Az Nir-Az merged commit cb43230 into realsenseai:development Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants