Compare commits

...

3 Commits

Author SHA1 Message Date
N00byKing
d02e966161 This *should* fix the clang error 2018-01-17 19:53:03 +01:00
N00byKing
90ba54c201 Update bootmanager.cpp 2018-01-16 17:42:17 +01:00
N00byKing
8b097aa17e Implement Pull #3333 from citra: citra_qt: Pause emulation on CoreError (#39) 2018-01-16 11:32:27 -05:00
2 changed files with 3 additions and 13 deletions

View File

@@ -1,12 +1,8 @@
#include <QApplication>
#include <QHBoxLayout>
#include <QKeyEvent>
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// Required for screen DPI information
#include <QScreen>
#include <QWindow>
#endif
#include "common/microprofile.h"
#include "common/scm_rev.h"
@@ -40,6 +36,7 @@ void EmuThread::run() {
Core::System::ResultStatus result = Core::System::GetInstance().RunLoop();
if (result != Core::System::ResultStatus::Success) {
this->SetRunning(false);
emit ErrorThrown(result, Core::System::GetInstance().GetStatusDetails());
}
@@ -119,15 +116,13 @@ GRenderWindow::~GRenderWindow() {
void GRenderWindow::moveContext() {
DoneCurrent();
// We need to move GL context to the swapping thread in Qt5
#if QT_VERSION > QT_VERSION_CHECK(5, 0, 0)
// If the thread started running, move the GL Context to the new thread. Otherwise, move it
// back.
auto thread = (QThread::currentThread() == qApp->thread() && emu_thread != nullptr)
? emu_thread
: qApp->thread();
child->context()->moveToThread(thread);
#endif
}
void GRenderWindow::SwapBuffers() {
@@ -190,12 +185,8 @@ QByteArray GRenderWindow::saveGeometry() {
}
qreal GRenderWindow::windowPixelRatio() {
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// windowHandle() might not be accessible until the window is displayed to screen.
return windowHandle() ? windowHandle()->screen()->devicePixelRatio() : 1.0f;
#else
return 1.0f;
#endif
}
void GRenderWindow::closeEvent(QCloseEvent* event) {
@@ -298,9 +289,7 @@ void GRenderWindow::OnEmulationStopping() {
void GRenderWindow::showEvent(QShowEvent* event) {
QWidget::showEvent(event);
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
// windowHandle() is not initialized until the Window is shown, so we connect it here.
connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this,
SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection);
#endif
}

View File

@@ -726,6 +726,7 @@ void GMainWindow::OnCoreError(Core::System::ResultStatus result, std::string det
} else {
// Only show the message if the game is still running.
if (emu_thread) {
emu_thread->SetRunning(true);
message_label->setText(status_message);
message_label->setVisible(true);
}