Skip to content
Permalink
Browse files

Fix the screen going black on pause after changing windows

  • Loading branch information...
Pokechu22 committed Apr 23, 2019
1 parent ab44a70 commit 0cb27cc42cfbfee78b16ea436ca60cd9d2bd6086
Showing with 9 additions and 1 deletion.
  1. +8 −1 Source/Core/DolphinQt/RenderWidget.cpp
  2. +1 −0 Source/Core/DolphinQt/RenderWidget.h
@@ -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)
@@ -19,6 +19,7 @@ class RenderWidget final : public QWidget

bool event(QEvent* event) override;
void showFullScreen();
QPaintEngine* paintEngine() const override;

signals:
void EscapePressed();

0 comments on commit 0cb27cc

Please sign in to comment.
You can’t perform that action at this time.