Skip to content

Commit

Permalink
Fix overlay highlight getting stuck when hiding Overlay Properties wi…
Browse files Browse the repository at this point in the history
…ndow while hovering its title bar
  • Loading branch information
elvissteinjr committed Dec 4, 2023
1 parent 16bbea5 commit ee66709
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/DesktopPlusUI/FloatingWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,17 @@ void FloatingWindow::WindowUpdateBase()
if ( (!UIManager::Get()->IsInDesktopMode()) && (alpha_prev != m_Alpha) )
vr::VROverlay()->SetOverlayAlpha(GetOverlayHandle(), m_Alpha);

//Finish transition fade if one's active
if ((m_Alpha == 0.0f) && (m_IsTransitionFading))
if (m_Alpha == 0.0f)
{
OverlayStateSwitchFinish();
//Not the best spot, but it can be difficult to cancel an active overlay hightlight when disappearing since the window code isn't running anymore
//So instead we always cancel the current highlight here, which shouldn't be problematic
UIManager::Get()->HighlightOverlay(k_ulOverlayID_None);

//Finish transition fade if one's active
if (m_IsTransitionFading)
{
OverlayStateSwitchFinish();
}
}
}

Expand Down Expand Up @@ -88,7 +95,7 @@ void FloatingWindow::WindowUpdateBase()

ImGui::Begin(m_WindowID.c_str(), nullptr, flags);

m_IsTitleBarHovered = ImGui::IsItemHovered(); //Current item is the title bar (needs to be checked before BeginTitleBar())
m_IsTitleBarHovered = ((ImGui::IsItemHovered()) && (m_OverlayStateCurrent->IsVisible)); //Current item is the title bar (needs to be checked before BeginTitleBar())
m_IsWindowAppearing = ImGui::IsWindowAppearing();

//Title bar
Expand Down

0 comments on commit ee66709

Please sign in to comment.