Qt: Fix undesired screen filtering when paused (fixes #1602)
Vicki Pfau vi@endrift.com
Fri, 20 Dec 2019 21:11:29 -0800
3 files changed,
11 insertions(+),
1 deletions(-)
M
CHANGES
→
CHANGES
@@ -103,6 +103,7 @@ - Qt: Fix scrollbar arrows in memory view (fixes mgba.io/i/1558)
- Qt: Fix several cases where shader selections don't get saved - Qt: Fix division by zero error in invalid TilePainter state - Qt: Fix "restart needed" dialog after first config (fixes mgba.io/i/1601) + - Qt: Fix undesired screen filtering when paused (fixes mgba.io/i/1602) Misc: - GB Memory: Support manual SRAM editing (fixes mgba.io/i/1580) - SDL: Use controller GUID instead of name
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -259,6 +259,7 @@ if (m_display) {
m_display->lockAspectRatio(opts->lockAspectRatio); m_display->filter(opts->resampleVideo); } + m_screenWidget->filter(opts->resampleVideo); m_inputController.setScreensaverSuspendable(opts->suspendScreensaver); }@@ -909,6 +910,7 @@ m_display->lockAspectRatio(opts->lockAspectRatio);
m_display->lockIntegerScaling(opts->lockIntegerScaling); m_display->interframeBlending(opts->interframeBlending); m_display->filter(opts->resampleVideo); + m_screenWidget->filter(opts->resampleVideo); m_config->updateOption("showOSD"); #if defined(BUILD_GL) || defined(BUILD_GLES2) if (opts->shader) {@@ -1387,6 +1389,7 @@ resampleVideo->connect([this](const QVariant& value) {
if (m_display) { m_display->filter(value.toBool()); } + m_screenWidget->filter(value.toBool()); }, this); m_config->updateOption("resampleVideo");@@ -1948,11 +1951,15 @@ void WindowBackground::setLockAspectRatio(bool lock) {
m_lockAspectRatio = lock; } +void WindowBackground::filter(bool filter) { + m_filter = filter; +} + void WindowBackground::paintEvent(QPaintEvent* event) { QWidget::paintEvent(event); const QPixmap& logo = pixmap(); QPainter painter(this); - painter.setRenderHint(QPainter::SmoothPixmapTransform); + painter.setRenderHint(QPainter::SmoothPixmapTransform, m_filter); painter.fillRect(QRect(QPoint(), size()), Qt::black); QSize s = size(); QSize ds = s;
M
src/platform/qt/Window.h
→
src/platform/qt/Window.h
@@ -245,6 +245,7 @@ virtual QSize sizeHint() const override;
void setDimensions(int width, int height); void setLockIntegerScaling(bool lock); void setLockAspectRatio(bool lock); + void filter(bool filter); const QPixmap& pixmap() const { return m_pixmap; }@@ -258,6 +259,7 @@ int m_aspectWidth;
int m_aspectHeight; bool m_lockAspectRatio; bool m_lockIntegerScaling; + bool m_filter; }; }