From 315b8b5b8f151951be1046800123ef040e8a7d47 Mon Sep 17 00:00:00 2001 From: Ramuh Date: Sun, 22 Mar 2015 01:37:08 +0100 Subject: [PATCH] Fix for Issue #449 Qt errors on startup. windowHandle() is not initialized until the Window is shown. Moved the slot connect to main.cpp file after show(). Had to change the OnFramebufferSizeChanged(); to a slot. --- src/citra_qt/bootmanager.cpp | 4 ---- src/citra_qt/bootmanager.h | 6 +++--- src/citra_qt/main.cpp | 4 ++++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index b81bd6167..e1cf5fd14 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -168,10 +168,6 @@ GRenderWindow::GRenderWindow(QWidget* parent) : QWidget(parent), emu_thread(this NotifyClientAreaSizeChanged(std::pair(child->width(), child->height())); BackupGeometry(); - -#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) - connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged())); -#endif } void GRenderWindow::moveContext() diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 288da45a1..930ccfab7 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -128,12 +128,12 @@ public: void ReloadSetKeymaps() override; void OnClientAreaResized(unsigned width, unsigned height); - - void OnFramebufferSizeChanged(); - + public slots: void moveContext(); // overridden + void OnFramebufferSizeChanged(); + private: void OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index e5ca04124..6e98a1b3e 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -160,6 +160,10 @@ GMainWindow::GMainWindow() show(); + #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + connect(render_window->windowHandle(), SIGNAL(screenChanged(QScreen*)), render_window, SLOT(OnFramebufferSizeChanged())); + #endif + QStringList args = QApplication::arguments(); if (args.length() >= 2) { BootGame(args[1].toStdString());