Skip to content

Commit

Permalink
Qt/MainWindow: Maintain pointer to hotkey window
Browse files Browse the repository at this point in the history
Prevents multiple hotkey windows from being opened.
  • Loading branch information
stenzek committed Oct 14, 2018
1 parent 211a9bf commit ea77899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Source/Core/DolphinQt/MainWindow.cpp
Expand Up @@ -937,13 +937,15 @@ void MainWindow::ShowAboutDialog()

void MainWindow::ShowHotkeyDialog()
{
auto* hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0);

InstallHotkeyFilter(hotkey_window);
if (!m_hotkey_window)
{
m_hotkey_window = new MappingWindow(this, MappingWindow::Type::MAPPING_HOTKEYS, 0);
InstallHotkeyFilter(m_hotkey_window);
}

hotkey_window->show();
hotkey_window->raise();
hotkey_window->activateWindow();
m_hotkey_window->show();
m_hotkey_window->raise();
m_hotkey_window->activateWindow();
}

void MainWindow::ShowGraphicsWindow()
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/DolphinQt/MainWindow.h
Expand Up @@ -29,6 +29,7 @@ class HotkeyScheduler;
class JITWidget;
class LogConfigWidget;
class LogWidget;
class MappingWindow;
class MemoryWidget;
class MenuBar;
class NetPlayDialog;
Expand Down Expand Up @@ -184,6 +185,7 @@ class MainWindow final : public QMainWindow
SettingsWindow* m_settings_window = nullptr;
GraphicsWindow* m_graphics_window = nullptr;
FIFOPlayerWindow* m_fifo_window = nullptr;
MappingWindow* m_hotkey_window = nullptr;

HotkeyScheduler* m_hotkey_scheduler;
NetPlayDialog* m_netplay_dialog;
Expand Down

0 comments on commit ea77899

Please sign in to comment.