summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorvayne <vayne@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-26 16:52:51 +0000
committervayne <vayne@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-08-26 16:52:51 +0000
commit9ad95ec9fd8fcde117a89ccde617e1a14f594fdb (patch)
treeef8fb31fa4b08d808892090b7ba58ffe0faa4b59 /Gui
parentda54059b05e027ad0fd420ffd8a49d5e19cda86d (diff)
downloadmpv-9ad95ec9fd8fcde117a89ccde617e1a14f594fdb.tar.bz2
mpv-9ad95ec9fd8fcde117a89ccde617e1a14f594fdb.tar.xz
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
Diffstat (limited to 'Gui')
-rw-r--r--Gui/win32/gui.c11
-rw-r--r--Gui/win32/interface.c26
2 files changed, 22 insertions, 15 deletions
diff --git a/Gui/win32/gui.c b/Gui/win32/gui.c
index 599dffa8bf..9a6e6e862a 100644
--- a/Gui/win32/gui.c
+++ b/Gui/win32/gui.c
@@ -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)
diff --git a/Gui/win32/interface.c b/Gui/win32/interface.c
index 0cc499fb8a..e7278a5a5c 100644
--- a/Gui/win32/interface.c
+++ b/Gui/win32/interface.c
@@ -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;