From f67c52a27d4647cd444955671d57a7b8949eaddb Mon Sep 17 00:00:00 2001 From: LittleWhite Date: Wed, 26 Aug 2015 22:04:12 +0200 Subject: [PATCH] Fix for the refresh issue when no rendering is done --- src/citra_qt/bootmanager.cpp | 14 +++++++++++--- src/citra_qt/bootmanager.h | 9 +++++---- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index f8aacb527..3d3347a64 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -11,17 +11,16 @@ #include "bootmanager.h" #include "main.h" -#include "common/string_util.h" -#include "common/scm_rev.h" #include "common/key_map.h" +#include "common/scm_rev.h" #include "common/microprofile.h" +#include "common/string_util.h" #include "core/core.h" #include "core/settings.h" #include "core/system.h" #include "video_core/debug_utils/debug_utils.h" - #include "video_core/video_core.h" #include "citra_qt/version.h" @@ -87,6 +86,9 @@ public: } void paintEvent(QPaintEvent* ev) override { + if (do_painting) { + QPainter painter(this); + } } void resizeEvent(QResizeEvent* ev) override { @@ -94,8 +96,12 @@ public: parent->OnFramebufferSizeChanged(); } + void DisablePainting() { do_painting = false; } + void EnablePainting() { do_painting = true; } + private: GRenderWindow* parent; + bool do_painting; }; GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) : @@ -269,8 +275,10 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pairemu_thread = emu_thread; + child->DisablePainting(); } void GRenderWindow::OnEmulationStopping() { emu_thread = nullptr; + child->EnablePainting(); } diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 1a1e0e6a5..215941d5a 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -6,17 +6,18 @@ #include #include -#include #include +#include #include "common/emu_window.h" #include "common/thread.h" -class QScreen; class QKeyEvent; +class QScreen; -class GRenderWindow; +class GGLWidgetInternal; class GMainWindow; +class GRenderWindow; class EmuThread : public QThread { @@ -132,7 +133,7 @@ public slots: private: void OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; - QGLWidget* child; + GGLWidgetInternal* child; QByteArray geometry;