From 84a8264e2e66d292dd38ce75e8c0f4a418e412f1 Mon Sep 17 00:00:00 2001 From: Memphiz Date: Thu, 1 Aug 2013 18:10:33 +0200 Subject: [guidialog] - fix autoclose by moveing the autoclose logic into UpdateVisibility for ensuring that getframetime returns sane values - thx to jm for the solution --- xbmc/guilib/GUIDialog.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/xbmc/guilib/GUIDialog.cpp b/xbmc/guilib/GUIDialog.cpp index 79434c8abe..83d3b3bfb4 100644 --- a/xbmc/guilib/GUIDialog.cpp +++ b/xbmc/guilib/GUIDialog.cpp @@ -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 ¶m /* = "" */) @@ -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(); } -- cgit v1.2.3