mirror of
https://github.com/mpv-player/mpv
synced 2025-03-22 11:18:32 +00:00
further improvements to fullscreen switching.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19414 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
66146dd85b
commit
8ccc7ac50d
@ -556,7 +556,6 @@ static LRESULT CALLBACK SubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
int tmpheight=0;
|
int tmpheight=0;
|
||||||
static uint32_t rect_width;
|
static uint32_t rect_width;
|
||||||
static uint32_t rect_height;
|
static uint32_t rect_height;
|
||||||
DWORD style, flags;
|
|
||||||
RECT rd;
|
RECT rd;
|
||||||
POINT pt;
|
POINT pt;
|
||||||
while(ShowCursor(TRUE) <= 0){}
|
while(ShowCursor(TRUE) <= 0){}
|
||||||
@ -581,18 +580,10 @@ static LRESULT CALLBACK SubProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
|
|||||||
rd.right = rd.left + rect_width;
|
rd.right = rd.left + rect_width;
|
||||||
rd.bottom = rd.top + rect_height;
|
rd.bottom = rd.top + rect_height;
|
||||||
|
|
||||||
if(fullscreen)
|
AdjustWindowRect(&rd, WS_OVERLAPPEDWINDOW | WS_SIZEBOX, 0);
|
||||||
{
|
|
||||||
style = WS_VISIBLE | WS_POPUP;
|
|
||||||
flags = SWP_NOZORDER | SWP_FRAMECHANGED;
|
|
||||||
} else {
|
|
||||||
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
|
|
||||||
flags = SWP_NOOWNERZORDER;
|
|
||||||
}
|
|
||||||
|
|
||||||
AdjustWindowRect(&rd, style, 0);
|
|
||||||
SetWindowPos(hWnd, 0, fullscreen?0:pt.x+rd.left, fullscreen?0:pt.y+rd.top,
|
SetWindowPos(hWnd, 0, fullscreen?0:pt.x+rd.left, fullscreen?0:pt.y+rd.top,
|
||||||
fullscreen?vo_screenwidth:rd.right-rd.left, fullscreen?vo_screenheight:rd.bottom-rd.top, flags);
|
fullscreen?vo_screenwidth:rd.right-rd.left, fullscreen?vo_screenheight:rd.bottom-rd.top, SWP_NOOWNERZORDER);
|
||||||
|
SetForegroundWindow(hWnd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
|
@ -403,7 +403,7 @@ void mplEnd( void )
|
|||||||
if (mygui->playlist->current == (mygui->playlist->trackcount - 1))
|
if (mygui->playlist->current == (mygui->playlist->trackcount - 1))
|
||||||
mygui->playlist->current = 0;
|
mygui->playlist->current = 0;
|
||||||
|
|
||||||
fullscreen = vo_fs = 0;
|
fullscreen = 0;
|
||||||
guiGetEvent(guiCEvent, (void *) guiSetStop);
|
guiGetEvent(guiCEvent, (void *) guiSetStop);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -697,32 +697,31 @@ int guiGetEvent(int type, char *arg)
|
|||||||
{
|
{
|
||||||
case MP_CMD_GUI_FULLSCREEN:
|
case MP_CMD_GUI_FULLSCREEN:
|
||||||
{
|
{
|
||||||
|
DWORD style;
|
||||||
|
/* vo_directx's fullscreen window */
|
||||||
|
HWND hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
|
||||||
|
|
||||||
if(!guiIntfStruct.sh_video) break;
|
if(!guiIntfStruct.sh_video) break;
|
||||||
|
|
||||||
/* FIXME: vo_directx is behaving unexpectedly, this maintains current functionality */
|
if(!sub_window)
|
||||||
if(!sub_window || (&video_driver_list && strstr(video_driver_list[0], "directx")))
|
|
||||||
{
|
{
|
||||||
video_out->control(VOCTRL_FULLSCREEN, 0);
|
video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!fullscreen)
|
if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
|
||||||
GetWindowRect(mygui->subwindow, &old_rect);
|
GetWindowRect(mygui->subwindow, &old_rect);
|
||||||
|
|
||||||
if(fullscreen)
|
if(fullscreen)
|
||||||
{
|
{
|
||||||
fullscreen = vo_fs = 0;
|
fullscreen = 0;
|
||||||
vo_dwidth = guiIntfStruct.MovieWidth = old_rect.right-old_rect.left;
|
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
|
||||||
vo_dheight = guiIntfStruct.MovieHeight = old_rect.bottom-old_rect.top;
|
|
||||||
vo_dx = old_rect.left;
|
|
||||||
vo_dy = old_rect.top;
|
|
||||||
} else {
|
} else {
|
||||||
fullscreen = vo_fs = 1;
|
fullscreen = 1;
|
||||||
vo_dwidth = guiIntfStruct.MovieWidth = vo_screenwidth;
|
style = WS_VISIBLE | WS_POPUP;
|
||||||
vo_dheight = guiIntfStruct.MovieHeight = vo_screenheight;
|
if(hWndFS) DestroyWindow(hWndFS);
|
||||||
vo_dx = 0;
|
|
||||||
vo_dy = 0;
|
|
||||||
}
|
}
|
||||||
|
SetWindowLong(mygui->subwindow, GWL_STYLE, style);
|
||||||
mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
|
mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
|
||||||
guiIntfStruct.MovieHeight, 0);
|
guiIntfStruct.MovieHeight, 0);
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user