sys: Fixed global shortcuts not working correctly

Fixes #606
This commit is contained in:
WerWolv
2022-07-30 22:01:49 +02:00
parent a097f162a7
commit 3d5568f65f
14 changed files with 63 additions and 30 deletions

View File

@@ -87,7 +87,7 @@ namespace hex {
EventManager::post<EventWindowClosing>(this->m_window);
});
EventManager::subscribe<EventFileUnloaded>(this, [] {
EventManager::subscribe<EventProviderDeleted>(this, [](const auto*) {
EventManager::post<RequestChangeWindowTitle>("");
});
@@ -163,7 +163,7 @@ namespace hex {
this->exitImGui();
this->exitGLFW();
EventManager::unsubscribe<EventFileUnloaded>(this);
EventManager::unsubscribe<EventProviderDeleted>(this);
EventManager::unsubscribe<RequestCloseImHex>(this);
EventManager::unsubscribe<RequestChangeWindowTitle>(this);
EventManager::unsubscribe<EventAbnormalTermination>(this);
@@ -416,6 +416,7 @@ namespace hex {
calls.clear();
}
auto &io = ImGui::GetIO();
for (auto &[name, view] : ContentRegistry::Views::getEntries()) {
ImGui::GetCurrentContext()->NextWindowData.ClearFlags();
@@ -442,13 +443,16 @@ namespace hex {
ImGui::End();
}
auto &io = ImGui::GetIO();
for (const auto &key : this->m_pressedKeys) {
ShortcutManager::process(view, io.KeyCtrl, io.KeyAlt, io.KeyShift, io.KeySuper, focused, key);
}
}
}
for (const auto &key : this->m_pressedKeys) {
ShortcutManager::processGlobals(io.KeyCtrl, io.KeyAlt, io.KeyShift, io.KeySuper, key);
}
this->m_pressedKeys.clear();
}