From fc8ef10853b44451f030fd23c530994975adeed4 Mon Sep 17 00:00:00 2001 From: OpenSauce04 Date: Fri, 2 Aug 2024 23:44:08 +0100 Subject: [PATCH] main.cpp: `connect_shortcut` now also connects to the secondary window --- src/lime_qt/main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lime_qt/main.cpp b/src/lime_qt/main.cpp index 1ff4d244e..3bd9f93e9 100644 --- a/src/lime_qt/main.cpp +++ b/src/lime_qt/main.cpp @@ -609,7 +609,7 @@ void GMainWindow::InitializeSaveStateMenuActions() { UpdateSaveStates(); } -void GMainWindow::InitializeHotkeys() { // TODO: This code kind of sucks +void GMainWindow::InitializeHotkeys() { hotkey_registry.LoadHotkeys(); const QString main_window = QStringLiteral("Main Window"); @@ -670,7 +670,9 @@ void GMainWindow::InitializeHotkeys() { // TODO: This code kind of sucks const auto connect_shortcut = [&](const QString& action_name, const auto& function) { const auto* hotkey = hotkey_registry.GetHotkey(main_window, action_name, this); + const auto* secondary_hotkey = hotkey_registry.GetHotkey(main_window, action_name, secondary_window); connect(hotkey, &QShortcut::activated, this, function); + connect(secondary_hotkey, &QShortcut::activated, this, function); }; connect(hotkey_registry.GetHotkey(main_window, toggle_screen_layout, render_window),