diff --git a/src/core/controller.cpp b/src/core/controller.cpp index f04ce2a7..b2756ee0 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -188,8 +188,10 @@ Controller::openInfoWindow() void Controller::openLauncherWindow() { - CaptureLauncher* w = new CaptureLauncher(); - w->show(); + if (!m_launcherWindow) { + m_launcherWindow = new CaptureLauncher(); + } + m_launcherWindow->show(); } void diff --git a/src/core/controller.h b/src/core/controller.h index ba9ac24d..86ccdfc6 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -29,7 +29,7 @@ class CaptureWidget; class ConfigWindow; class InfoWindow; class QSystemTrayIcon; - +class CaptureLauncher; using lambda = std::function; class Controller : public QObject @@ -82,6 +82,7 @@ private: QMap m_requestMap; QPointer m_captureWindow; QPointer m_infoWindow; + QPointer m_launcherWindow; QPointer m_configWindow; QPointer m_trayIcon; };