fix crash when selecting radar site with new ImGui contexts

This commit is contained in:
AdenKoperczak 2025-01-06 08:57:55 -05:00
parent 6d107f6c2d
commit 9bd5af03f9
3 changed files with 7 additions and 1 deletions

View file

@ -161,6 +161,10 @@ void DrawLayer::RenderWithoutImGui(
p->textureAtlasBuildCount_ = newTextureAtlasBuildCount;
}
void DrawLayer::ImGuiSelectContext()
{
ImGui::SetCurrentContext(p->imGuiContext_);
}
void DrawLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
{

View file

@ -37,6 +37,7 @@ protected:
void ImGuiInitialize();
void
RenderWithoutImGui(const QMapLibre::CustomLayerRenderParameters& params);
void ImGuiSelectContext();
private:
std::unique_ptr<DrawLayerImpl> p;

View file

@ -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