mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
Further fullscreen switching improvements. Fixes sub window position bug when exiting a file from fullscreen. Fixes sub window position when switching between windows and fullscreen modes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19541 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
da54059b05
commit
9ad95ec9fd
@ -309,6 +309,17 @@ static void updatedisplay(gui_t *gui, HWND hwnd)
|
||||
if((time - oldtime) < 100) return;
|
||||
oldtime=time;
|
||||
|
||||
/* suppress directx's fullscreen window when using the sub window */
|
||||
if(sub_window && &video_driver_list[0] && strstr("directx", video_driver_list[0]))
|
||||
{
|
||||
HWND hWndFS = NULL; //handle to directx's fullscreen window
|
||||
if(hWndFS == NULL)
|
||||
{
|
||||
hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
|
||||
if(hWndFS != NULL) DestroyWindow(hWndFS); //sub window handles fullscreen
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<gui->window_priv_count; i++)
|
||||
{
|
||||
if(gui->window_priv[i]->hwnd == hwnd)
|
||||
|
@ -68,6 +68,7 @@ int mplGotoTheNext = 1;
|
||||
static gui_t *mygui = NULL;
|
||||
static int update_subwindow(void);
|
||||
static RECT old_rect;
|
||||
static DWORD style;
|
||||
|
||||
/* test for playlist files, no need to specify -playlist on the commandline.
|
||||
* add any conceivable playlist extensions here.
|
||||
@ -404,6 +405,11 @@ void mplEnd( void )
|
||||
mygui->playlist->current = 0;
|
||||
|
||||
fullscreen = 0;
|
||||
if(style == WS_VISIBLE | WS_POPUP)
|
||||
{
|
||||
style = WS_OVERLAPPEDWINDOW | WS_SIZEBOX;
|
||||
SetWindowLong(mygui->subwindow, GWL_STYLE, style);
|
||||
}
|
||||
guiGetEvent(guiCEvent, (void *) guiSetStop);
|
||||
}
|
||||
|
||||
@ -434,9 +440,6 @@ static DWORD WINAPI GuiThread(void)
|
||||
gtkAutoSync = autosync;
|
||||
}
|
||||
|
||||
old_rect.left = gui_sub_pos_x;
|
||||
old_rect.top = gui_sub_pos_y;
|
||||
|
||||
while(mygui)
|
||||
{
|
||||
GetMessage(&msg, NULL, 0, 0);
|
||||
@ -670,9 +673,6 @@ int guiGetEvent(int type, char *arg)
|
||||
case guiSetPlay:
|
||||
{
|
||||
guiIntfStruct.Playing = 1;
|
||||
if(guiIntfStruct.sh_video && !IsIconic(mygui->subwindow)
|
||||
&& IsWindowVisible(mygui->subwindow) && !fullscreen)
|
||||
GetWindowRect(mygui->subwindow, &old_rect);
|
||||
break;
|
||||
}
|
||||
case guiSetStop:
|
||||
@ -697,10 +697,6 @@ int guiGetEvent(int type, char *arg)
|
||||
{
|
||||
case MP_CMD_GUI_FULLSCREEN:
|
||||
{
|
||||
DWORD style;
|
||||
/* vo_directx's fullscreen window */
|
||||
HWND hWndFS = FindWindow(NULL, "MPlayer Fullscreen");
|
||||
|
||||
if(!guiIntfStruct.sh_video) break;
|
||||
|
||||
if(!sub_window)
|
||||
@ -719,7 +715,6 @@ int guiGetEvent(int type, char *arg)
|
||||
} else {
|
||||
fullscreen = 1;
|
||||
style = WS_VISIBLE | WS_POPUP;
|
||||
if(hWndFS) DestroyWindow(hWndFS);
|
||||
}
|
||||
SetWindowLong(mygui->subwindow, GWL_STYLE, style);
|
||||
mpcodecs_config_vo(guiIntfStruct.sh_video, guiIntfStruct.MovieWidth,
|
||||
@ -944,14 +939,15 @@ static int update_subwindow(void)
|
||||
ShowWindow(mygui->subwindow, SW_SHOWNORMAL);
|
||||
|
||||
/* get our current window coordinates */
|
||||
if(fullscreen)
|
||||
GetWindowRect(mygui->subwindow, &rd);
|
||||
else
|
||||
CopyRect(&rd, &old_rect);
|
||||
GetWindowRect(mygui->subwindow, &rd);
|
||||
|
||||
x = rd.left;
|
||||
y = rd.top;
|
||||
|
||||
/* restore sub window position when coming out of fullscreen */
|
||||
if(x <= 0) x = old_rect.left;
|
||||
if(y <= 0) y = old_rect.top;
|
||||
|
||||
if(!guiIntfStruct.Playing)
|
||||
{
|
||||
window *desc = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user