This commit is contained in:
DavidXanatos 2024-03-09 12:37:38 +01:00
parent 17d928d456
commit 1651527fe2
2 changed files with 29 additions and 13 deletions

View File

@ -8,7 +8,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### Fixed ### Fixed
- fixed issues with "IsProtectScreen=y" [3656](https://github.com/sandboxie-plus/Sandboxie/pull/3656#discussion_r1518549704) - fixed issues with "IsProtectScreen=y" [3656](https://github.com/sandboxie-plus/Sandboxie/pull/3656#discussion_r1518549704)
- fixed issue with hotkeys and changed default suspend all hotkey to Shift+Alt+Pause
- fixed issue with suspended state not being updated when the global hotkey was used

View File

@ -2644,19 +2644,31 @@ void CSandMan::CheckSupport()
void CSandMan::SetupHotKeys() void CSandMan::SetupHotKeys()
{ {
m_pHotkeyManager->unregisterAllHotkeys(); QString HotKey;
try
{
m_pHotkeyManager->unregisterAllHotkeys();
if (theConf->GetBool("Options/EnablePanicKey", false)) HotKey = "PanicKey";
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Shift+Pause"), HK_PANIC); if (theConf->GetBool("Options/EnablePanicKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PanicKeySequence", "Shift+Pause"), HK_PANIC);
if (theConf->GetBool("Options/EnableTopMostKey", false)) HotKey = "TopMostKey";
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/TopMostKeySequence", "Alt+Pause"), HK_TOP); if (theConf->GetBool("Options/EnableTopMostKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/TopMostKeySequence", "Alt+Pause"), HK_TOP);
if (theConf->GetBool("Options/EnablePauseForceKey", false)) HotKey = "PauseForceKey";
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PauseForceKeySequence", "Ctrl+Alt+F"), HK_FORCE); if (theConf->GetBool("Options/EnablePauseForceKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/PauseForceKeySequence", "Ctrl+Alt+F"), HK_FORCE);
if (theConf->GetBool("Options/EnableSuspendKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/SuspendKeySequence", "Ctrl+Pause"), HK_SUSPEND); HotKey = "SuspendKey";
if (theConf->GetBool("Options/EnableSuspendKey", false))
m_pHotkeyManager->registerHotkey(theConf->GetString("Options/SuspendKeySequence", "Shift+Alt+Pause"), HK_SUSPEND);
}
catch (UException& err)
{
QMessageBox::critical(this, "Sandboxie-Plus", tr("Failed to configure hotkey %1, error: %2").arg(HotKey).arg(err.what()));
}
} }
void CSandMan::OnHotKey(size_t id) void CSandMan::OnHotKey(size_t id)
@ -2679,8 +2691,11 @@ void CSandMan::OnHotKey(size_t id)
case HK_SUSPEND: case HK_SUSPEND:
{ {
for (auto each : theAPI->GetAllBoxes()) for (auto pBox: theAPI->GetAllBoxes()) {
each->SetSuspendedAll(TRUE); pBox->SetSuspendedAll(TRUE);
for (auto pProcess : pBox->GetProcessList())
pProcess->TestSuspended();
}
break; break;
} }