From 1e1a64cd13bedf2c2003c57fcc5cd591179145c2 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sun, 24 Mar 2019 01:37:34 +0100 Subject: [PATCH] DATV demod: deactivate full screen. Fixed bug --- plugins/channelrx/demoddatv/datvdemodgui.cpp | 2 +- plugins/channelrx/demoddatv/datvdemodgui.ui | 2 +- .../channelrx/demoddatv/datvideorender.cpp | 36 +++++++++++-------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/plugins/channelrx/demoddatv/datvdemodgui.cpp b/plugins/channelrx/demoddatv/datvdemodgui.cpp index 403c07900..8208d7665 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.cpp +++ b/plugins/channelrx/demoddatv/datvdemodgui.cpp @@ -164,7 +164,7 @@ DATVDemodGUI::DATVDemodGUI(PluginAPI* objPluginAPI, DeviceUISet *deviceUISet, Ba connect(&m_objTimer, SIGNAL(timeout()), this, SLOT(tick())); m_objTimer.start(); - //ui->fullScreen->setVisible(false); + ui->fullScreen->setVisible(false); ui->deltaFrequencyLabel->setText(QString("%1f").arg(QChar(0x94, 0x03))); ui->deltaFrequency->setColorMapper(ColorMapper(ColorMapper::GrayGold)); diff --git a/plugins/channelrx/demoddatv/datvdemodgui.ui b/plugins/channelrx/demoddatv/datvdemodgui.ui index a8176937e..aeae3436a 100644 --- a/plugins/channelrx/demoddatv/datvdemodgui.ui +++ b/plugins/channelrx/demoddatv/datvdemodgui.ui @@ -204,7 +204,7 @@ QTabWidget::West - 1 + 0 diff --git a/plugins/channelrx/demoddatv/datvideorender.cpp b/plugins/channelrx/demoddatv/datvideorender.cpp index a117f824d..d6fbfd3db 100644 --- a/plugins/channelrx/demoddatv/datvideorender.cpp +++ b/plugins/channelrx/demoddatv/datvideorender.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include extern "C" { @@ -38,6 +38,7 @@ DATVideoRender::DATVideoRender(QWidget *parent) : TVScreen(true, parent), m_pare m_isOpen = false; m_formatCtx = nullptr; m_videoDecoderCtx = nullptr; + m_audioDecoderCtx = nullptr; m_swsCtx = nullptr; m_audioFifo = nullptr; m_audioSWR = nullptr; @@ -96,25 +97,30 @@ void DATVideoRender::SetFullScreen(bool fullScreen) if (fullScreen == true) { - m_originalWindowFlags = this->windowFlags(); - m_originalSize = this->size(); - this->setParent(0); - this->setWindowFlags( Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); - this->showMaximized(); - // setWindowFlags(Qt::Window); - // setWindowState(Qt::WindowFullScreen); - // show(); + qDebug("DATVideoRender::SetFullScreen: go to fullscreen"); + // m_originalWindowFlags = this->windowFlags(); + // m_originalSize = this->size(); + // m_parentWidget->layout()->removeWidget(this); + // //this->setParent(0); + // this->setWindowFlags( Qt::FramelessWindowHint|Qt::WindowStaysOnTopHint); + // m_parentWidget->show(); + setWindowFlags(Qt::Window); + setWindowState(Qt::WindowFullScreen); + show(); m_isFullScreen = true; } else { - this->setParent(m_parentWidget); - this->resize(m_originalSize); - this->overrideWindowFlags(m_originalWindowFlags); - this->show(); - // setWindowFlags(Qt::Widget); + qDebug("DATVideoRender::SetFullScreen: come back from fullscreen"); + // //this->setParent(m_parentWidget); + // this->resize(m_originalSize); + // this->overrideWindowFlags(m_originalWindowFlags); // setWindowState(Qt::WindowNoState); - // show(); + // m_parentWidget->layout()->addWidget(this); + // m_parentWidget->show(); + setWindowFlags(Qt::Widget); + setWindowState(Qt::WindowNoState); + show(); m_isFullScreen = false; } }