Commit ff51d50f authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

Win32, Added checking of correct using of fullscreen support

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 55dca7a8
......@@ -844,17 +844,27 @@ void VLCWindowsManager::DestroyWindows()
void VLCWindowsManager::LibVlcAttach(libvlc_media_player_t* p_md)
{
if(!_HolderWnd)
return;//VLCWindowsManager::CreateWindows was not called
_p_md=p_md;
libvlc_media_player_set_hwnd(p_md, _HolderWnd->getHWND());
}
void VLCWindowsManager::LibVlcDetach()
{
if(_p_md){
libvlc_media_player_set_hwnd(_p_md, 0);
}
_p_md=0;
}
void VLCWindowsManager::StartFullScreen()
{
if(!_HolderWnd)
return;//VLCWindowsManager::CreateWindows was not called
if(getMD()&&!IsFullScreen()){
if(!_FSWnd){
_FSWnd= VLCFullScreenWnd::CreateFSWindow(this);
......@@ -871,6 +881,9 @@ void VLCWindowsManager::StartFullScreen()
void VLCWindowsManager::EndFullScreen()
{
if(!_HolderWnd)
return;//VLCWindowsManager::CreateWindows was not called
if(IsFullScreen()){
SetParent(_HolderWnd->getHWND(), _hWindowedParentWnd);
......@@ -900,6 +913,6 @@ void VLCWindowsManager::ToggleFullScreen()
bool VLCWindowsManager::IsFullScreen()
{
return 0!=_FSWnd && GetParent(_HolderWnd->getHWND())==_FSWnd->getHWND();
return 0!=_FSWnd && 0!=_HolderWnd && GetParent(_HolderWnd->getHWND())==_FSWnd->getHWND();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment