1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 16:32:33 +02:00

Fix bug that the video window does not get pronely destroyed

This commit is contained in:
kelteseth 2017-10-26 13:50:16 +02:00
parent 00e66f3d9a
commit 7db96f1d5e
2 changed files with 28 additions and 6 deletions

View File

@ -25,14 +25,18 @@ Wallpaper::Wallpaper( ProjectFile project, Monitor monitor)
m_monitor = monitor;
m_project = project;
QString tmp = m_project.m_absoluteStoragePath.toString() + "/" + m_project.m_file.toString();
qDebug() << tmp;
tmp.replace("/","\\\\");
setAbsoluteFilePath(tmp);
qDebug() << tmp;
this->setX(m_profile.m_rect.x());
this->setY(m_profile.m_rect.y());
this->setWidth(m_profile.m_rect.width());
this->setHeight(m_profile.m_rect.height());
// this->setX(m_profile.m_rect.x());
// this->setY(m_profile.m_rect.y());
// this->setWidth(m_profile.m_rect.width());
// this->setHeight(m_profile.m_rect.height());
this->setX(m_monitor.m_availableGeometry.x());
this->setY(m_monitor.m_availableGeometry.y());
this->setWidth(m_monitor.m_availableGeometry.width());
this->setHeight(m_monitor.m_availableGeometry.height());
this->m_hwnd = (HWND)this->winId();
HWND progman_hwnd = FindWindowW(L"Progman", L"Program Manager");
@ -70,10 +74,26 @@ qDebug() << tmp;
Wallpaper::~Wallpaper()
{
//this->setVisible(false);
//m_quickRenderer->destroy();
this->setPosition(QPoint(500,500));
ShowWindow(m_hwnd, SW_HIDE);
ShowWindow(m_worker_hwnd, SW_HIDE);
CloseWindow(m_hwnd);
DestroyWindow(m_worker_hwnd);
DestroyWindow(m_hwnd);
}
Monitor Wallpaper::monitor() const
{
return m_monitor;
}
void Wallpaper::setVisible(bool visible)
{
if (visible)
ShowWindow(m_hwnd, SW_SHOWDEFAULT);
else
ShowWindow(m_hwnd, SW_HIDE);
}

View File

@ -56,6 +56,8 @@ public slots:
emit isPlayingChanged(m_isPlaying);
}
void setVisible(bool visible);
signals:
void absoluteFilePathChanged(QString absoluteFilePath);