diff --git a/scwx-qt/source/scwx/qt/map/draw_layer.cpp b/scwx-qt/source/scwx/qt/map/draw_layer.cpp index 4dc24f89..9588a160 100644 --- a/scwx-qt/source/scwx/qt/map/draw_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/draw_layer.cpp @@ -161,8 +161,12 @@ void DrawLayer::RenderWithoutImGui( p->textureAtlasBuildCount_ = newTextureAtlasBuildCount; } +void DrawLayer::ImGuiSelectContext() +{ + ImGui::SetCurrentContext(p->imGuiContext_); +} - void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) +void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params) { StartImGuiFrame(); RenderWithoutImGui(params); diff --git a/scwx-qt/source/scwx/qt/map/draw_layer.hpp b/scwx-qt/source/scwx/qt/map/draw_layer.hpp index 416c4e7f..a6fd685a 100644 --- a/scwx-qt/source/scwx/qt/map/draw_layer.hpp +++ b/scwx-qt/source/scwx/qt/map/draw_layer.hpp @@ -37,6 +37,7 @@ protected: void ImGuiInitialize(); void RenderWithoutImGui(const QMapLibre::CustomLayerRenderParameters& params); + void ImGuiSelectContext(); private: std::unique_ptr p; diff --git a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp index 431af597..7398ab36 100644 --- a/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_site_layer.cpp @@ -140,6 +140,7 @@ void RadarSiteLayer::Impl::RenderRadarSite( if (ImGui::Button(radarSite->id().c_str())) { Q_EMIT self_->RadarSiteSelected(radarSite->id()); + self_->ImGuiSelectContext(); } // Store hover text for mouse picking pass