mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-24 20:51:05 +00:00
Fix for the refresh issue when no rendering is done
This commit is contained in:
parent
bc59aaccb1
commit
f67c52a27d
@ -11,17 +11,16 @@
|
|||||||
#include "bootmanager.h"
|
#include "bootmanager.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
#include "common/string_util.h"
|
|
||||||
#include "common/scm_rev.h"
|
|
||||||
#include "common/key_map.h"
|
#include "common/key_map.h"
|
||||||
|
#include "common/scm_rev.h"
|
||||||
#include "common/microprofile.h"
|
#include "common/microprofile.h"
|
||||||
|
#include "common/string_util.h"
|
||||||
|
|
||||||
#include "core/core.h"
|
#include "core/core.h"
|
||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
|
|
||||||
#include "video_core/debug_utils/debug_utils.h"
|
#include "video_core/debug_utils/debug_utils.h"
|
||||||
|
|
||||||
#include "video_core/video_core.h"
|
#include "video_core/video_core.h"
|
||||||
|
|
||||||
#include "citra_qt/version.h"
|
#include "citra_qt/version.h"
|
||||||
@ -87,6 +86,9 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void paintEvent(QPaintEvent* ev) override {
|
void paintEvent(QPaintEvent* ev) override {
|
||||||
|
if (do_painting) {
|
||||||
|
QPainter painter(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void resizeEvent(QResizeEvent* ev) override {
|
void resizeEvent(QResizeEvent* ev) override {
|
||||||
@ -94,8 +96,12 @@ public:
|
|||||||
parent->OnFramebufferSizeChanged();
|
parent->OnFramebufferSizeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DisablePainting() { do_painting = false; }
|
||||||
|
void EnablePainting() { do_painting = true; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GRenderWindow* parent;
|
GRenderWindow* parent;
|
||||||
|
bool do_painting;
|
||||||
};
|
};
|
||||||
|
|
||||||
GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :
|
GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) :
|
||||||
@ -269,8 +275,10 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,un
|
|||||||
|
|
||||||
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
|
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
|
||||||
this->emu_thread = emu_thread;
|
this->emu_thread = emu_thread;
|
||||||
|
child->DisablePainting();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::OnEmulationStopping() {
|
void GRenderWindow::OnEmulationStopping() {
|
||||||
emu_thread = nullptr;
|
emu_thread = nullptr;
|
||||||
|
child->EnablePainting();
|
||||||
}
|
}
|
||||||
|
@ -6,17 +6,18 @@
|
|||||||
#include <condition_variable>
|
#include <condition_variable>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
|
|
||||||
#include <QThread>
|
|
||||||
#include <QGLWidget>
|
#include <QGLWidget>
|
||||||
|
#include <QThread>
|
||||||
|
|
||||||
#include "common/emu_window.h"
|
#include "common/emu_window.h"
|
||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
|
|
||||||
class QScreen;
|
|
||||||
class QKeyEvent;
|
class QKeyEvent;
|
||||||
|
class QScreen;
|
||||||
|
|
||||||
class GRenderWindow;
|
class GGLWidgetInternal;
|
||||||
class GMainWindow;
|
class GMainWindow;
|
||||||
|
class GRenderWindow;
|
||||||
|
|
||||||
class EmuThread : public QThread
|
class EmuThread : public QThread
|
||||||
{
|
{
|
||||||
@ -132,7 +133,7 @@ public slots:
|
|||||||
private:
|
private:
|
||||||
void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) override;
|
void OnMinimalClientAreaChangeRequest(const std::pair<unsigned,unsigned>& minimal_size) override;
|
||||||
|
|
||||||
QGLWidget* child;
|
GGLWidgetInternal* child;
|
||||||
|
|
||||||
QByteArray geometry;
|
QByteArray geometry;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user