VERY experimental Nintendo Switch 2 emulator
C++
citra-qt: Fix connect error on startup
Kloen98aa9421dbe1
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cppindex 7a1360d34f..bb9b204f38 100644--- a/src/citra_qt/bootmanager.cpp+++ b/src/citra_qt/bootmanager.cpp@@ -128,9 +128,6 @@ GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :BackupGeometry();-#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)- connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()));-#endif}void GRenderWindow::moveContext()@@ -278,3 +275,12 @@ void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {void GRenderWindow::OnEmulationStopping() {emu_thread = nullptr;}++void GRenderWindow::showEvent(QShowEvent * event) {+ QWidget::showEvent(event);++ // windowHandle() is not initialized until the Window is shown, so we connect it here.+ #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)+ connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);+ #endif+}diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.hindex dc422358e9..2fd6113678 100644--- a/src/citra_qt/bootmanager.h+++ b/src/citra_qt/bootmanager.h@@ -123,13 +123,12 @@ public:void OnClientAreaResized(unsigned width, unsigned height);- void OnFramebufferSizeChanged();-public slots:void moveContext(); // overriddenvoid OnEmulationStarting(EmuThread* emu_thread);void OnEmulationStopping();+ void OnFramebufferSizeChanged();signals:/// Emitted when the window is closed@@ -146,4 +145,7 @@ private:int keyboard_id;EmuThread* emu_thread;++protected:+ void showEvent(QShowEvent* event) override;};