diff options
Diffstat (limited to 'src/citra_qt/bootmanager.cpp')
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 1e902a8b6..4be410fe0 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -87,8 +87,8 @@ private: | |||
| 87 | GRenderWindow* parent; | 87 | GRenderWindow* parent; |
| 88 | }; | 88 | }; |
| 89 | 89 | ||
| 90 | GRenderWindow::GRenderWindow(QWidget* parent, GMainWindow& main_window) : | 90 | GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) : |
| 91 | QWidget(parent), main_window(main_window), keyboard_id(0) { | 91 | QWidget(parent), emu_thread(emu_thread), keyboard_id(0) { |
| 92 | 92 | ||
| 93 | std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); | 93 | std::string window_title = Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); |
| 94 | setWindowTitle(QString::fromStdString(window_title)); | 94 | setWindowTitle(QString::fromStdString(window_title)); |
| @@ -129,7 +129,7 @@ void GRenderWindow::moveContext() | |||
| 129 | // We need to move GL context to the swapping thread in Qt5 | 129 | // We need to move GL context to the swapping thread in Qt5 |
| 130 | #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) | 130 | #if QT_VERSION > QT_VERSION_CHECK(5, 0, 0) |
| 131 | // If the thread started running, move the GL Context to the new thread. Otherwise, move it back. | 131 | // If the thread started running, move the GL Context to the new thread. Otherwise, move it back. |
| 132 | auto thread = QThread::currentThread() == qApp->thread() ? main_window.GetEmuThread() : qApp->thread(); | 132 | auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr) ? emu_thread : qApp->thread(); |
| 133 | child->context()->moveToThread(thread); | 133 | child->context()->moveToThread(thread); |
| 134 | #endif | 134 | #endif |
| 135 | } | 135 | } |
| @@ -272,3 +272,11 @@ void GRenderWindow::OnClientAreaResized(unsigned width, unsigned height) | |||
| 272 | void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) { | 272 | void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) { |
| 273 | setMinimumSize(minimal_size.first, minimal_size.second); | 273 | setMinimumSize(minimal_size.first, minimal_size.second); |
| 274 | } | 274 | } |
| 275 | |||
| 276 | void GRenderWindow::OnEmulationStarted(EmuThread* emu_thread) { | ||
| 277 | this->emu_thread = emu_thread; | ||
| 278 | } | ||
| 279 | |||
| 280 | void GRenderWindow::OnEmulationStopped() { | ||
| 281 | emu_thread = nullptr; | ||
| 282 | } | ||