From 457d7cf58f60f507223b87df315184e28244f644 Mon Sep 17 00:00:00 2001 From: spycrab Date: Tue, 3 Jul 2018 08:24:45 +0200 Subject: [PATCH] Qt/MainWindow: Lazily initialize hotkey mapping window --- Source/Core/DolphinQt2/MainWindow.cpp | 13 +++++++------ Source/Core/DolphinQt2/MainWindow.h | 2 -- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 25326547db8e..926b62273e71 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -258,8 +258,6 @@ void MainWindow::CreateComponents() m_wii_tas_input_windows[controller_id]->GetValues(input_data, rptf, ext, key); }); - m_hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0); - m_jit_widget = new JITWidget(this); m_log_widget = new LogWidget(this); m_log_config_widget = new LogConfigWidget(this); @@ -304,7 +302,6 @@ void MainWindow::CreateComponents() m_graphics_window = new GraphicsWindow(nullptr, this); #endif - InstallHotkeyFilter(m_hotkey_window); InstallHotkeyFilter(m_controllers_window); InstallHotkeyFilter(m_settings_window); InstallHotkeyFilter(m_graphics_window); @@ -928,9 +925,13 @@ void MainWindow::ShowAboutDialog() void MainWindow::ShowHotkeyDialog() { - m_hotkey_window->show(); - m_hotkey_window->raise(); - m_hotkey_window->activateWindow(); + auto* hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0); + + InstallHotkeyFilter(hotkey_window); + + hotkey_window->show(); + hotkey_window->raise(); + hotkey_window->activateWindow(); } void MainWindow::ShowGraphicsWindow() diff --git a/Source/Core/DolphinQt2/MainWindow.h b/Source/Core/DolphinQt2/MainWindow.h index 3f922672ede4..5d80b923e000 100644 --- a/Source/Core/DolphinQt2/MainWindow.h +++ b/Source/Core/DolphinQt2/MainWindow.h @@ -33,7 +33,6 @@ class HotkeyScheduler; class JITWidget; class LogConfigWidget; class LogWidget; -class MappingWindow; class MemoryWidget; class NetPlayClient; class NetPlayDialog; @@ -182,7 +181,6 @@ class MainWindow final : public QMainWindow HotkeyScheduler* m_hotkey_scheduler; ControllersWindow* m_controllers_window; SettingsWindow* m_settings_window; - MappingWindow* m_hotkey_window; NetPlayDialog* m_netplay_dialog; NetPlaySetupDialog* m_netplay_setup_dialog; GraphicsWindow* m_graphics_window;