From 0093206dd8e8253d39e5b172705590f7c433c18d Mon Sep 17 00:00:00 2001 From: Ramuh Date: Sun, 22 Mar 2015 02:54:19 +0100 Subject: [PATCH] Added showEvent() method to GRenderWindow to keep GMainWindow clean --- src/citra_qt/bootmanager.cpp | 8 ++++++++ src/citra_qt/bootmanager.h | 3 +++ src/citra_qt/main.cpp | 6 +----- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index e1cf5fd14..c2374b7e4 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -331,3 +331,11 @@ void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) { setMinimumSize(minimal_size.first, minimal_size.second); } + +void GRenderWindow::showEvent(QShowEvent * event) { + QWidget::showEvent(event); + + #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged())); + #endif +} \ No newline at end of file diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 46f56cbb5..4f42c6261 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -145,4 +145,7 @@ private: /// Device id of keyboard for use with KeyMap int keyboard_id; + +protected: + void showEvent(QShowEvent * event) override; }; diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 06f8c7233..81bca9316 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -159,11 +159,7 @@ GMainWindow::GMainWindow() setWindowTitle(window_title.c_str()); 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());