diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp index d69bb0ccb..227029a91 100644 --- a/src/qt/qt_mainwindow.cpp +++ b/src/qt/qt_mainwindow.cpp @@ -1154,7 +1154,7 @@ static void update_fullscreen_scale_checkboxes(Ui::MainWindow* ui, QAction* sele if (video_fullscreen > 0) { auto widget = ui->stackedWidget->currentWidget(); - auto rc = dynamic_cast(widget); + auto rc = ui->stackedWidget->rendererWindow; rc->onResize(widget->width(), widget->height()); } diff --git a/src/qt/qt_rendererstack.cpp b/src/qt/qt_rendererstack.cpp index fab8783b9..c736baa5d 100644 --- a/src/qt/qt_rendererstack.cpp +++ b/src/qt/qt_rendererstack.cpp @@ -183,6 +183,7 @@ void RendererStack::switchRenderer(Renderer renderer) { case Renderer::Software: { auto sw = new SoftwareRenderer(this); + rendererWindow = sw; connect(this, &RendererStack::blitToRenderer, sw, &SoftwareRenderer::onBlit, Qt::QueuedConnection); current.reset(this->createWindowContainer(sw, this)); } @@ -191,6 +192,7 @@ void RendererStack::switchRenderer(Renderer renderer) { { this->createWinId(); auto hw = new HardwareRenderer(this); + rendererWindow = hw; connect(this, &RendererStack::blitToRenderer, hw, &HardwareRenderer::onBlit, Qt::QueuedConnection); current.reset(this->createWindowContainer(hw, this)); break; @@ -199,6 +201,7 @@ void RendererStack::switchRenderer(Renderer renderer) { { this->createWinId(); auto hw = new HardwareRenderer(this, HardwareRenderer::RenderType::OpenGLES); + rendererWindow = hw; connect(this, &RendererStack::blitToRenderer, hw, &HardwareRenderer::onBlit, Qt::QueuedConnection); current.reset(this->createWindowContainer(hw, this)); break; @@ -207,6 +210,7 @@ void RendererStack::switchRenderer(Renderer renderer) { { this->createWinId(); auto hw = new HardwareRenderer(this, HardwareRenderer::RenderType::OpenGL3); + rendererWindow = hw; connect(this, &RendererStack::blitToRenderer, hw, &HardwareRenderer::onBlit, Qt::QueuedConnection); current.reset(this->createWindowContainer(hw, this)); break; diff --git a/src/qt/qt_rendererstack.hpp b/src/qt/qt_rendererstack.hpp index 8ad1e39db..7a82fc527 100644 --- a/src/qt/qt_rendererstack.hpp +++ b/src/qt/qt_rendererstack.hpp @@ -13,6 +13,7 @@ namespace Ui { class RendererStack; } +class RendererCommon; class RendererStack : public QStackedWidget { Q_OBJECT @@ -43,6 +44,7 @@ public: }; void switchRenderer(Renderer renderer); + RendererCommon* rendererWindow{nullptr}; signals: void blitToRenderer(const std::unique_ptr* img, int, int, int, int, std::atomic_flag* in_use);