Permalink
Browse files

Qt/MainWindow: Maintain pointer to hotkey window

Prevents multiple hotkey windows from being opened.
  • Loading branch information...
stenzek committed Oct 14, 2018
1 parent 211a9bf commit ea77899ddd4484229bda1cc5016a158b707ec75d
Showing with 10 additions and 6 deletions.
  1. +8 −6 Source/Core/DolphinQt/MainWindow.cpp
  2. +2 −0 Source/Core/DolphinQt/MainWindow.h
@@ -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()
@@ -29,6 +29,7 @@ class HotkeyScheduler;
class JITWidget;
class LogConfigWidget;
class LogWidget;
class MappingWindow;
class MemoryWidget;
class MenuBar;
class NetPlayDialog;
@@ -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;

0 comments on commit ea77899

Please sign in to comment.