Skip to content

Commit

Permalink
Make MythWelcome spawn MythFrontend in the UI thread again due to pro…
Browse files Browse the repository at this point in the history
…blems with LIRC but allow events to be processed. This prevents extra key presses being queued and allows them to be ignored until MythFrontend has returned.
  • Loading branch information
peper03 committed Apr 20, 2015
1 parent 554046a commit 5d5eb04
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions mythtv/programs/mythwelcome/welcomedialog.cpp
Expand Up @@ -8,7 +8,6 @@
#include <QCoreApplication>
#include <QKeyEvent>
#include <QEvent>
#include <qtconcurrentrun.h>

// myth
#include "exitcodes.h"
Expand Down Expand Up @@ -105,14 +104,11 @@ bool WelcomeDialog::Create(void)

void WelcomeDialog::startFrontend(void)
{
// this makes sure the button appears to click properly
usleep(500 * 1000);

QString startFECmd = gCoreContext->GetSetting("MythWelcomeStartFECmd",
m_installDir + "/bin/mythfrontend");

myth_system(startFECmd, kMSDisableUDPListener);

myth_system(startFECmd, kMSDisableUDPListener | kMSProcessEvents);
updateAll();
m_frontendIsRunning = false;
}

Expand All @@ -123,7 +119,8 @@ void WelcomeDialog::startFrontendClick(void)

m_frontendIsRunning = true;

QtConcurrent::run(this, &WelcomeDialog::startFrontend);
// this makes sure the button appears to click properly
QTimer::singleShot(500, this, SLOT(startFrontend()));
}

void WelcomeDialog::checkAutoStart(void)
Expand Down
2 changes: 1 addition & 1 deletion mythtv/programs/mythwelcome/welcomedialog.h
Expand Up @@ -32,6 +32,7 @@ class WelcomeDialog : public MythScreenType

protected slots:
void startFrontendClick(void);
void startFrontend(void);
void updateAll(void);
void updateStatus(void);
void updateScreen(void);
Expand All @@ -45,7 +46,6 @@ class WelcomeDialog : public MythScreenType
bool updateScheduledList(void);

private:
void startFrontend(void);
void updateStatusMessage(void);
bool checkConnectionToServer(void);
void checkAutoStart(void);
Expand Down

0 comments on commit 5d5eb04

Please sign in to comment.