summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2015-09-22 03:16:48 +0200
committerbunnei <bunneidev@gmail.com>2015-09-22 03:16:48 +0200
commitca5ea5142deec687e42f86add5026c1ade2c1093 (patch)
tree62940e905ce6eae0b15249482ff62e12dfc33e6d
parentMerge pull request #1167 from Cruel/master (diff)
parentcitra-qt: Fix connect error on startup (diff)
downloadyuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar.gz
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar.bz2
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar.lz
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar.xz
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.tar.zst
yuzu-ca5ea5142deec687e42f86add5026c1ade2c1093.zip
-rw-r--r--src/citra_qt/bootmanager.cpp12
-rw-r--r--src/citra_qt/bootmanager.h6
2 files changed, 13 insertions, 5 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp
index 7a1360d34..bb9b204f3 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.h
index dc422358e..2fd611367 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(); // overridden
void 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;
};