mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-29 23:06:23 -05:00
Fix for the refresh issue when no rendering is done
This commit is contained in:
parent
09f43c0975
commit
d06824809f
2 changed files with 14 additions and 4 deletions
|
@ -19,8 +19,8 @@
|
||||||
#include "core/settings.h"
|
#include "core/settings.h"
|
||||||
#include "core/system.h"
|
#include "core/system.h"
|
||||||
|
|
||||||
#include "video_core/video_core.h"
|
|
||||||
#include "video_core/debug_utils/debug_utils.h"
|
#include "video_core/debug_utils/debug_utils.h"
|
||||||
|
#include "video_core/video_core.h"
|
||||||
|
|
||||||
#define APP_NAME "citra"
|
#define APP_NAME "citra"
|
||||||
#define APP_VERSION "0.1-" VERSION
|
#define APP_VERSION "0.1-" VERSION
|
||||||
|
@ -86,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 {
|
||||||
|
@ -93,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) :
|
||||||
|
@ -270,10 +277,12 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GRenderWindow::showEvent(QShowEvent * event) {
|
void GRenderWindow::showEvent(QShowEvent * event) {
|
||||||
|
|
|
@ -12,11 +12,12 @@
|
||||||
#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
|
||||||
{
|
{
|
||||||
|
@ -137,7 +138,7 @@ signals:
|
||||||
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 a new issue