diff --git a/mythtv/libs/libmythui/mythmainwindow.cpp b/mythtv/libs/libmythui/mythmainwindow.cpp index fd7a2842875..0ceee0636ee 100644 --- a/mythtv/libs/libmythui/mythmainwindow.cpp +++ b/mythtv/libs/libmythui/mythmainwindow.cpp @@ -1058,6 +1058,11 @@ void MythMainWindow::SetDrawEnabled(bool enable) setUpdatesEnabled(enable); d->m_drawEnabled = enable; + if (enable) + d->drawTimer->start(1000 / 70); + else + d->drawTimer->stop(); + // TODO FIXME // Sleep 50 ms to give any in progress draw a chance to finish. // This should be replaced with something sane after MythTV 0.22 diff --git a/mythtv/libs/libmythui/mythsystem.cpp b/mythtv/libs/libmythui/mythsystem.cpp index 91a5f3b86be..2189e3bdbbd 100644 --- a/mythtv/libs/libmythui/mythsystem.cpp +++ b/mythtv/libs/libmythui/mythsystem.cpp @@ -58,6 +58,9 @@ uint myth_system(const QString &command, int flags) bool ready_to_lock = HasMythMainWindow(); (void)ready_to_lock; /* Kill warning */ + + uint result = GENERIC_EXIT_NOT_OK; + #ifdef USE_LIRC bool lirc_lock_flag = !(flags & MYTH_SYSTEM_DONT_BLOCK_LIRC); LircEventLock lirc_lock(lirc_lock_flag && ready_to_lock); @@ -75,6 +78,9 @@ uint myth_system(const QString &command, int flags) flags |= MYTH_SYSTEM_DONT_BLOCK_PARENT; #endif + if (ready_to_lock && !(flags & MYTH_SYSTEM_DONT_BLOCK_PARENT)) + GetMythMainWindow()->SetDrawEnabled(false); + QString LOC_ERR = QString("myth_system('%1'): Error: ").arg(command); #ifndef USING_MINGW @@ -85,7 +91,7 @@ uint myth_system(const QString &command, int flags) /* Fork failed */ VERBOSE(VB_IMPORTANT, (LOC_ERR + "fork() failed because %1") .arg(strerror(errno))); - return GENERIC_EXIT_NOT_OK; + result = GENERIC_EXIT_NOT_OK; } else if (child == 0) { @@ -141,14 +147,18 @@ uint myth_system(const QString &command, int flags) VERBOSE(VB_IMPORTANT, (LOC_ERR + "waitpid() failed because %1") .arg(strerror(errno))); - return GENERIC_EXIT_NOT_OK; + result = GENERIC_EXIT_NOT_OK; + break; } qApp->processEvents(); if (res > 0) - return WEXITSTATUS(status); + { + result = WEXITSTATUS(status); + break; + } usleep(100000); } @@ -159,9 +169,10 @@ uint myth_system(const QString &command, int flags) { VERBOSE(VB_IMPORTANT, (LOC_ERR + "waitpid() failed because %1") .arg(strerror(errno))); - return GENERIC_EXIT_NOT_OK; + result = GENERIC_EXIT_NOT_OK; } - return WEXITSTATUS(status); + else + result = WEXITSTATUS(status); } } @@ -196,6 +207,10 @@ uint myth_system(const QString &command, int flags) return exitcode; } #endif - return GENERIC_EXIT_NOT_OK; + + if (ready_to_lock && !(flags & MYTH_SYSTEM_DONT_BLOCK_PARENT)) + GetMythMainWindow()->SetDrawEnabled(true); + + return result; }