Skip to content

Commit

Permalink
Merge pull request #3027 from Memphiz/fixautoclose
Browse files Browse the repository at this point in the history
[guidialog] - fix autoclose
  • Loading branch information
Memphiz committed Aug 3, 2013
2 parents 77295c6 + 84a8264 commit 60965df
Showing 1 changed file with 17 additions and 16 deletions.
33 changes: 17 additions & 16 deletions xbmc/guilib/GUIDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,23 @@ void CGUIDialog::UpdateVisibility()
else
Close();
}

if (m_autoClosing)
{ // check if our timer is running
if (!m_showStartTime)
{
if (HasProcessed()) // start timer
m_showStartTime = CTimeUtils::GetFrameTime();
}
else
{
if (m_showStartTime + m_showDuration < CTimeUtils::GetFrameTime() && !m_closing)
{
m_bAutoClosed = true;
Close();
}
}
}
}

void CGUIDialog::DoModal_Internal(int iWindowID /*= WINDOW_INVALID */, const CStdString &param /* = "" */)
Expand Down Expand Up @@ -230,22 +247,6 @@ void CGUIDialog::Show()

void CGUIDialog::FrameMove()
{
if (m_autoClosing)
{ // check if our timer is running
if (!m_showStartTime)
{
if (HasProcessed()) // start timer
m_showStartTime = CTimeUtils::GetFrameTime();
}
else
{
if (m_showStartTime + m_showDuration < CTimeUtils::GetFrameTime() && !m_closing)
{
m_bAutoClosed = true;
Close();
}
}
}
CGUIWindow::FrameMove();
}

Expand Down

0 comments on commit 60965df

Please sign in to comment.