diff --git a/src/core/Application.cpp b/src/core/Application.cpp index 6a8948b..56ca395 100644 --- a/src/core/Application.cpp +++ b/src/core/Application.cpp @@ -299,12 +299,14 @@ void Application::RenderUI() { ImGui::Text("Device"); ImGui::Indent(); for (const auto& device : m_availableDevices) { + ImGui::PushID(device.path.c_str()); bool isSelected = (device.path == m_currentDevice); - if (ImGui::MenuItem(device.toString().c_str(), nullptr, isSelected)) { + if (ImGui::MenuItem(device.displayName().c_str(), nullptr, isSelected)) { if (!isSelected) { SwitchDevice(device.path); } } + ImGui::PopID(); } ImGui::Unindent(); ImGui::Spacing(); @@ -330,12 +332,14 @@ void Application::RenderUI() { ImGui::Text("Device"); ImGui::Indent(); for (const auto& device : m_availableAudioDevices) { + ImGui::PushID(device.name.c_str()); bool isSelected = (device.name == m_currentAudioDevice); if (ImGui::MenuItem(device.toString().c_str(), nullptr, isSelected)) { if (!isSelected) { SwitchAudioDevice(device.name); } } + ImGui::PopID(); } ImGui::Unindent(); ImGui::Spacing(); diff --git a/src/video/V4L2Capabilities.h b/src/video/V4L2Capabilities.h index 1ce6505..5014d03 100644 --- a/src/video/V4L2Capabilities.h +++ b/src/video/V4L2Capabilities.h @@ -24,6 +24,10 @@ struct VideoDevice { std::string toString() const { return name + " (" + path + ")"; } + + std::string displayName() const { + return name; + } }; class V4L2Capabilities {