diff --git a/src/mumble/Overlay_win.cpp b/src/mumble/Overlay_win.cpp index 002891fc3..4b5dda0bd 100644 --- a/src/mumble/Overlay_win.cpp +++ b/src/mumble/Overlay_win.cpp @@ -72,7 +72,6 @@ static bool canRun64BitPrograms() { } OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) { - m_allow64bit = canRun64BitPrograms(); m_active = false; m_helper_exe_path = QString::fromLatin1("%1/mumble_ol.exe").arg(qApp->applicationDirPath()); @@ -92,6 +91,11 @@ OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) { m_helper_restart_timer->setSingleShot(true); connect(m_helper_restart_timer, SIGNAL(timeout()), this, SLOT(onDelayedRestartTimerTriggered())); + if (!g.s.bOverlayWinHelperX86Enable) { + qWarning("OverlayPrivateWin: mumble_ol.exe (32-bit overlay helper) disabled via 'overlay_win/enable_x86_helper' config option."); + m_helper_enabled = false; + } + m_helper64_exe_path = QString::fromLatin1("%1/mumble_ol_x64.exe").arg(qApp->applicationDirPath()); m_helper64_exe_args = m_helper_exe_args; m_helper64_process = new QProcess(this); @@ -108,6 +112,14 @@ OverlayPrivateWin::OverlayPrivateWin(QObject *p) : OverlayPrivate(p) { m_helper64_restart_timer = new QTimer(this); m_helper64_restart_timer->setSingleShot(true); connect(m_helper64_restart_timer, SIGNAL(timeout()), this, SLOT(onDelayedRestartTimerTriggered())); + + if (!canRun64BitPrograms()) { + qWarning("OverlayPrivateWin: mumble_ol_x64.exe (64-bit overlay helper) disabled because the host is not x64 capable."); + m_helper64_enabled = false; + } else if (!g.s.bOverlayWinHelperX64Enable) { + qWarning("OverlayPrivateWin: mumble_ol_x64.exe (64-bit overlay helper) disabled via 'overlay_win/enable_x64_helper' config option."); + m_helper64_enabled = false; + } } OverlayPrivateWin::~OverlayPrivateWin() { @@ -133,13 +145,17 @@ void OverlayPrivateWin::setActive(bool active) { m_active = active; if (m_active) { - startHelper(m_helper_process); - if (m_allow64bit) { + if (m_helper_enabled) { + startHelper(m_helper_process); + } + if (m_helper64_enabled) { startHelper(m_helper64_process); } } else { - m_helper_process->terminate(); - if (m_allow64bit) { + if (m_helper_enabled) { + m_helper_process->terminate(); + } + if (m_helper64_enabled) { m_helper64_process->terminate(); } } diff --git a/src/mumble/Overlay_win.h b/src/mumble/Overlay_win.h index 1041c2d2a..4fb6bd7c0 100644 --- a/src/mumble/Overlay_win.h +++ b/src/mumble/Overlay_win.h @@ -62,15 +62,16 @@ class OverlayPrivateWin : public OverlayPrivate { QStringList m_helper_exe_args; QElapsedTimer m_helper_start_time; QTimer *m_helper_restart_timer; + bool m_helper_enabled; QProcess *m_helper64_process; QString m_helper64_exe_path; QStringList m_helper64_exe_args; QElapsedTimer m_helper64_start_time; QTimer *m_helper64_restart_timer; + bool m_helper64_enabled; bool m_active; - bool m_allow64bit; void startHelper(QProcess *helper); }; diff --git a/src/mumble/Settings.cpp b/src/mumble/Settings.cpp index 845be36b5..0c3a6e7cc 100644 --- a/src/mumble/Settings.cpp +++ b/src/mumble/Settings.cpp @@ -347,6 +347,8 @@ Settings::Settings() { // OverlayPrivateWin iOverlayWinHelperRestartCooldownMsec = 10000; + bOverlayWinHelperX86Enable = true; + bOverlayWinHelperX64Enable = true; iLCDUserViewMinColWidth = 50; iLCDUserViewSplitterWidth = 2; @@ -702,6 +704,8 @@ void Settings::load(QSettings* settings_ptr) { // OverlayPrivateWin SAVELOAD(iOverlayWinHelperRestartCooldownMsec, "overlay_win/helper/restart_cooldown_msec"); + SAVELOAD(bOverlayWinHelperX86Enable, "overlay_win/helper/x86/enable"); + SAVELOAD(bOverlayWinHelperX64Enable, "overlay_win/helper/x64/enable"); // LCD SAVELOAD(iLCDUserViewMinColWidth, "lcd/userview/mincolwidth"); @@ -997,6 +1001,8 @@ void Settings::save() { // OverlayPrivateWin SAVELOAD(iOverlayWinHelperRestartCooldownMsec, "overlay_win/helper/restart_cooldown_msec"); + SAVELOAD(bOverlayWinHelperX86Enable, "overlay_win/helper/x86/enable"); + SAVELOAD(bOverlayWinHelperX64Enable, "overlay_win/helper/x64/enable"); // LCD SAVELOAD(iLCDUserViewMinColWidth, "lcd/userview/mincolwidth"); diff --git a/src/mumble/Settings.h b/src/mumble/Settings.h index fda5a5c41..9c60b06b5 100644 --- a/src/mumble/Settings.h +++ b/src/mumble/Settings.h @@ -231,6 +231,8 @@ struct Settings { OverlaySettings os; int iOverlayWinHelperRestartCooldownMsec; + bool bOverlayWinHelperX86Enable; + bool bOverlayWinHelperX64Enable; int iLCDUserViewMinColWidth; int iLCDUserViewSplitterWidth;