Skip to content
Snippets Groups Projects
Commit aa98041e authored by Pierre Lamot's avatar Pierre Lamot Committed by Jean-Baptiste Kempf
Browse files

win32: fix Controls/toolbar never appears over embed element (ref #18831)


Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 67b528c7
No related branches found
No related tags found
No related merge requests found
......@@ -443,9 +443,10 @@ void VLCControlsWnd::RegisterToVLCEvents()
void VLCControlsWnd::NeedShowControls()
{
if( !(GetWindowLong(hWnd(), GWL_STYLE) & WS_VISIBLE) ) {
if(WM().IsFullScreen() || (PO() && PO()->get_show_toolbar() ) )
ShowWindow( hWnd(), SW_SHOW );
if ( WM().IsFullScreen() || (PO() && PO()->get_show_toolbar()) )
{
SetWindowPos( hWnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
ShowWindow( hWnd(), SW_SHOW );
}
SetTimer(hWnd(), 1, 2 * 1000, nullptr);
}
......@@ -898,6 +899,19 @@ void VLCWindowsManager::StartFullScreen()
FSFlags);
ShowWindow(_FSWnd->getHWND(), SW_SHOW);
HWND controlWindow = _HolderWnd->ControlWindow()->hWnd();
//parenting to NULL promotes window to WS_POPUP
SetParent(controlWindow, NULL);
//Ensure control window is on the right screen
RECT controlRect;
GetWindowRect(controlWindow, &controlRect);
OffsetRect(&controlRect, FSRect.left - controlRect.left, FSRect.bottom - controlRect.bottom);
SetWindowPos(controlWindow, HWND_TOPMOST,
controlRect.left, controlRect.top,
controlRect.right - controlRect.left, controlRect.bottom - controlRect.top,
SWP_FRAMECHANGED);
}
}
......@@ -918,6 +932,10 @@ void VLCWindowsManager::EndFullScreen()
_FSWnd->DestroyWindow();
_FSWnd = nullptr;
HWND controlWindow = _HolderWnd->ControlWindow()->hWnd();
SetParent(controlWindow, _HolderWnd->hWnd());
SetWindowPos(controlWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment