mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2024-11-10 13:44:17 +00:00
Work around broken overlay state restoration in Qt GUI
This commit is contained in:
parent
197c1ba21b
commit
5ea79efe4b
1 changed files with 15 additions and 1 deletions
|
@ -4,7 +4,9 @@
|
|||
SLVideoDecoder::SLVideoDecoder(bool)
|
||||
: m_VideoContext(nullptr),
|
||||
m_VideoStream(nullptr),
|
||||
m_Overlay(nullptr)
|
||||
m_Overlay(nullptr),
|
||||
m_ViewportWidth(0),
|
||||
m_ViewportHeight(0)
|
||||
{
|
||||
SLVideo_SetLogFunction(SLVideoDecoder::slLogCallback, nullptr);
|
||||
}
|
||||
|
@ -26,6 +28,18 @@ SLVideoDecoder::~SLVideoDecoder()
|
|||
}
|
||||
|
||||
if (m_VideoContext != nullptr) {
|
||||
if (session != nullptr && m_ViewportWidth != 0 && m_ViewportHeight != 0) {
|
||||
// HACK: Fix the overlay that Qt uses to render otherwise the GUI will
|
||||
// be squished into an overlay the size of what Moonlight used.
|
||||
CSLVideoOverlay* hackOverlay = SLVideo_CreateOverlay(m_VideoContext, m_ViewportWidth, m_ViewportHeight);
|
||||
|
||||
// Quickly show and hide the overlay to flush the overlay changes to the display hardware
|
||||
SLVideo_SetOverlayDisplayFullscreen(hackOverlay);
|
||||
SLVideo_ShowOverlay(hackOverlay);
|
||||
SLVideo_HideOverlay(hackOverlay);
|
||||
SLVideo_FreeOverlay(hackOverlay);
|
||||
}
|
||||
|
||||
SLVideo_FreeContext(m_VideoContext);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue