From 78ef9e11055cb8ac40761f0ec0ce4fc2e1c963f4 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Thu, 30 Nov 2023 13:29:26 +1000 Subject: [PATCH] Qt: Fix opening memcard editor more than once --- src/duckstation-qt/mainwindow.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 716b38082..3968ac76b 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -2707,14 +2707,18 @@ void MainWindow::openMemoryCardEditor(const QString& card_a_path, const QString& } if (!m_memory_card_editor_window) - { m_memory_card_editor_window = new MemoryCardEditorWindow(); + + if (!m_memory_card_editor_window->isVisible()) + { m_memory_card_editor_window->show(); } - - m_memory_card_editor_window->raise(); - m_memory_card_editor_window->activateWindow(); - m_memory_card_editor_window->setFocus(); + else + { + m_memory_card_editor_window->raise(); + m_memory_card_editor_window->activateWindow(); + m_memory_card_editor_window->setFocus(); + } if (!card_a_path.isEmpty()) {