Skip to content

Commit

Permalink
Merge pull request #8026 from Pokechu22/fix-black-pause
Browse files Browse the repository at this point in the history
Fix the screen going black on pause after changing windows
  • Loading branch information
stenzek committed Apr 28, 2019
2 parents ab44a70 + 0cb27cc commit 96c69fd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Source/Core/DolphinQt/RenderWidget.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions Source/Core/DolphinQt/RenderWidget.h
Expand Up @@ -19,6 +19,7 @@ class RenderWidget final : public QWidget

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

signals:
void EscapePressed();
Expand Down

0 comments on commit 96c69fd

Please sign in to comment.