Qt/RenderWidget: Remove fill background functionality

We no longer need this since the video backend handles clearing the
window, and it fixes MoltenVK with Qt 5.14.
This commit is contained in:
Stenzek 2020-03-11 23:13:42 +10:00
parent 2f016295a6
commit cdb0aa850d
2 changed files with 2 additions and 17 deletions

View File

@ -58,9 +58,6 @@ 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)
SetImGuiKeyMap();
});
@ -91,21 +88,12 @@ RenderWidget::RenderWidget(QWidget* parent) : QWidget(parent)
// We need a native window to render into.
setAttribute(Qt::WA_NativeWindow);
SetFillBackground(true);
}
void RenderWidget::SetFillBackground(bool fill)
{
setAutoFillBackground(fill);
setAttribute(Qt::WA_OpaquePaintEvent, !fill);
setAttribute(Qt::WA_NoSystemBackground, !fill);
setAttribute(Qt::WA_PaintOnScreen, !fill);
setAttribute(Qt::WA_PaintOnScreen);
}
QPaintEngine* RenderWidget::paintEngine() const
{
return autoFillBackground() ? QWidget::paintEngine() : nullptr;
return nullptr;
}
void RenderWidget::dragEnterEvent(QDragEnterEvent* event)
@ -178,8 +166,6 @@ bool RenderWidget::event(QEvent* event)
switch (event->type())
{
case QEvent::Paint:
return !autoFillBackground();
case QEvent::KeyPress:
{
QKeyEvent* ke = static_cast<QKeyEvent*>(event);

View File

@ -33,7 +33,6 @@ private:
void HandleCursorTimer();
void OnHideCursorChanged();
void OnKeepOnTopChanged(bool top);
void SetFillBackground(bool fill);
void OnFreeLookMouseMove(QMouseEvent* event);
void PassEventToImGui(const QEvent* event);
void SetImGuiKeyMap();