summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2019-04-22 20:29:04 -0700
committerPokechu22 <Pokechu022@gmail.com>2019-04-27 23:26:44 -0700
commit0cb27cc42cfbfee78b16ea436ca60cd9d2bd6086 (patch)
tree412d9f44cf4d48aa5a7730121457b588bff6bf93 /Source
parentab44a7065d4c73c31aebf7081a9f8b666ba8f931 (diff)
Fix the screen going black on pause after changing windows
More info: https://zeduckmaster.frama.io/2016/how-to-create-a-custom-rendering-in-a-qt5-widget/
Diffstat (limited to 'Source')
-rw-r--r--Source/Core/DolphinQt/RenderWidget.cpp9
-rw-r--r--Source/Core/DolphinQt/RenderWidget.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/DolphinQt/RenderWidget.cpp b/Source/Core/DolphinQt/RenderWidget.cpp
index 45427c1a60..1d2ffddc0f 100644
--- a/Source/Core/DolphinQt/RenderWidget.cpp
+++ b/Source/Core/DolphinQt/RenderWidget.cpp
@@ -52,6 +52,7 @@ RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent)
});
connect(&Settings::Instance(), &Settings::EmulationStateChanged, this, [this](Core::State state) {
+ // Stop filling the background once emulation starts, but fill it until then (Bug 10958)
SetFillBackground(Config::Get(Config::MAIN_RENDER_TO_MAIN) &&
state == Core::State::Uninitialized);
if (state == Core::State::Running)
@@ -90,9 +91,15 @@ RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent)
void RenderWidget::SetFillBackground(bool fill)
{
+ setAutoFillBackground(fill);
setAttribute(Qt::WA_OpaquePaintEvent, !fill);
setAttribute(Qt::WA_NoSystemBackground, !fill);
- setAutoFillBackground(fill);
+ setAttribute(Qt::WA_PaintOnScreen, !fill);
+}
+
+QPaintEngine* RenderWidget::paintEngine() const
+{
+ return autoFillBackground() ? QWidget::paintEngine() : nullptr;
}
void RenderWidget::dragEnterEvent(QDragEnterEvent* event)
diff --git a/Source/Core/DolphinQt/RenderWidget.h b/Source/Core/DolphinQt/RenderWidget.h
index df4f34d93e..818e9209ab 100644
--- a/Source/Core/DolphinQt/RenderWidget.h
+++ b/Source/Core/DolphinQt/RenderWidget.h
@@ -19,6 +19,7 @@ public:
bool event(QEvent* event) override;
void showFullScreen();
+ QPaintEngine* paintEngine() const override;
signals:
void EscapePressed();