diff options
| author | 2022-04-23 16:21:23 -0400 | |
|---|---|---|
| committer | 2022-04-23 16:21:23 -0400 | |
| commit | 7f77aafe41051c5fa8c7729e8743af2c09f3365e (patch) | |
| tree | a0f78bf751ec52fb78cbd49b1d492aac9800074d /src | |
| parent | Merge pull request #8243 from lat9nq/boost-just-error (diff) | |
| parent | hotkeys: Trigger actions on a separate thread (diff) | |
| download | yuzu-7f77aafe41051c5fa8c7729e8743af2c09f3365e.tar.gz yuzu-7f77aafe41051c5fa8c7729e8743af2c09f3365e.tar.xz yuzu-7f77aafe41051c5fa8c7729e8743af2c09f3365e.zip | |
Merge pull request #8249 from german77/queued
hotkeys: Trigger actions on a separate thread
Diffstat (limited to 'src')
| -rw-r--r-- | src/yuzu/main.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 5e26aad29..f607f464a 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -933,8 +933,9 @@ void GMainWindow::LinkActionShortcut(QAction* action, const QString& action_name | |||
| 933 | auto* controller = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); | 933 | auto* controller = system->HIDCore().GetEmulatedController(Core::HID::NpadIdType::Player1); |
| 934 | const auto* controller_hotkey = | 934 | const auto* controller_hotkey = |
| 935 | hotkey_registry.GetControllerHotkey(main_window, action_name, controller); | 935 | hotkey_registry.GetControllerHotkey(main_window, action_name, controller); |
| 936 | connect(controller_hotkey, &ControllerShortcut::Activated, this, | 936 | connect( |
| 937 | [action] { action->trigger(); }); | 937 | controller_hotkey, &ControllerShortcut::Activated, this, [action] { action->trigger(); }, |
| 938 | Qt::QueuedConnection); | ||
| 938 | } | 939 | } |
| 939 | 940 | ||
| 940 | void GMainWindow::InitializeHotkeys() { | 941 | void GMainWindow::InitializeHotkeys() { |
| @@ -961,7 +962,8 @@ void GMainWindow::InitializeHotkeys() { | |||
| 961 | const auto* controller_hotkey = | 962 | const auto* controller_hotkey = |
| 962 | hotkey_registry.GetControllerHotkey(main_window, action_name, controller); | 963 | hotkey_registry.GetControllerHotkey(main_window, action_name, controller); |
| 963 | connect(hotkey, &QShortcut::activated, this, function); | 964 | connect(hotkey, &QShortcut::activated, this, function); |
| 964 | connect(controller_hotkey, &ControllerShortcut::Activated, this, function); | 965 | connect(controller_hotkey, &ControllerShortcut::Activated, this, function, |
| 966 | Qt::QueuedConnection); | ||
| 965 | }; | 967 | }; |
| 966 | 968 | ||
| 967 | connect_shortcut(QStringLiteral("Exit Fullscreen"), [&] { | 969 | connect_shortcut(QStringLiteral("Exit Fullscreen"), [&] { |