mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 05:41:16 +00:00
simplify and modify fullscreen switching to avoid improper aspects
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22407 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
6ed7b7d849
commit
3e97fa2450
@ -431,6 +431,30 @@ void mplSetFileName(char *dir, char *name, int type)
|
||||
free((void **) &guiIntfStruct.Subtitlename);
|
||||
}
|
||||
|
||||
void mplFullScreen( void )
|
||||
{
|
||||
if(!guiIntfStruct.sh_video) return;
|
||||
|
||||
if(sub_window)
|
||||
{
|
||||
if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
|
||||
GetWindowRect(mygui->subwindow, &old_rect);
|
||||
|
||||
if(fullscreen)
|
||||
{
|
||||
fullscreen = 0;
|
||||
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
|
||||
} else {
|
||||
fullscreen = 1;
|
||||
style = WS_VISIBLE | WS_POPUP;
|
||||
}
|
||||
SetWindowLong(mygui->subwindow, GWL_STYLE, style);
|
||||
update_subwindow();
|
||||
}
|
||||
video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
if(sub_window) ShowWindow(mygui->subwindow, SW_SHOW);
|
||||
}
|
||||
|
||||
static DWORD WINAPI GuiThread(void)
|
||||
{
|
||||
MSG msg;
|
||||
@ -643,31 +667,8 @@ int guiGetEvent(int type, char *arg)
|
||||
switch((int) arg)
|
||||
{
|
||||
case MP_CMD_GUI_FULLSCREEN:
|
||||
{
|
||||
if(!guiIntfStruct.sh_video) break;
|
||||
|
||||
if(!sub_window)
|
||||
{
|
||||
video_out->control(VOCTRL_FULLSCREEN, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
if(!fullscreen && IsWindowVisible(mygui->subwindow) && !IsIconic(mygui->subwindow))
|
||||
GetWindowRect(mygui->subwindow, &old_rect);
|
||||
|
||||
if(fullscreen)
|
||||
{
|
||||
fullscreen = 0;
|
||||
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
|
||||
} else {
|
||||
fullscreen = 1;
|
||||
style = WS_VISIBLE | WS_POPUP;
|
||||
}
|
||||
SetWindowLong(mygui->subwindow, GWL_STYLE, style);
|
||||
mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
|
||||
guiIntfStruct.MovieHeight, 0);
|
||||
mplFullScreen();
|
||||
break;
|
||||
}
|
||||
case MP_CMD_QUIT:
|
||||
{
|
||||
mygui->uninit(mygui);
|
||||
|
Loading…
Reference in New Issue
Block a user