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;