diff -Naur -wbBE -X ignore_list main-cvs/libvo/vo_directx.c main-devel/libvo/vo_directx.c --- main-cvs/libvo/vo_directx.c 2005-02-28 10:07:23.000000000 +0800 +++ main-devel/libvo/vo_directx.c 2005-05-09 14:04:24.000000000 +0800 @@ -53,6 +53,9 @@ static RECT rs; //rect of our source image static HWND hWnd=NULL; //handle to the window static HWND hWndFS=NULL; //fullscreen window +static HBRUSH colorbrush = NULL; // Handle to colorkey brush +static HBRUSH blackbrush = NULL; // Handle to black brush +static HICON mplayericon = NULL; // Handle mplayer icon static uint32_t image_width, image_height; //image width and height static uint32_t d_image_width, d_image_height; //image width and height zoomed static uint8_t *image=NULL; //image data @@ -345,7 +348,9 @@ g_lpddsPrimary = NULL; mp_msg(MSGT_VO, MSGL_DBG3,"primary released\n"); if(hWndFS)DestroyWindow(hWndFS); - if(hWnd != NULL)DestroyWindow(hWnd); + hWndFS = NULL; + if((WinID == -1) && hWnd) DestroyWindow(hWnd); + hWnd = NULL; mp_msg(MSGT_VO, MSGL_DBG3,"window destroyed\n"); if (g_lpdd != NULL){ if(vidmode)g_lpdd->lpVtbl->RestoreDisplayMode(g_lpdd); @@ -521,8 +526,11 @@ aspect(&width,&height,A_ZOOM); rd.left=(vo_screenwidth-width)/2; rd.top=(vo_screenheight-height)/2; + if (WinID == -1) + { if(ShowCursor(FALSE)>=0)while(ShowCursor(FALSE)>=0){} } + } else if (WinID != -1 && vo_geometry) { POINT pt; pt.x = vo_dx; @@ -562,8 +570,11 @@ } else height=tmpheight; } + if (WinID == -1) + { while(ShowCursor(TRUE)<=0){} } + } rd.right=rd.left+width; rd.bottom=rd.top+height; @@ -985,7 +996,6 @@ static uint32_t preinit(const char *arg) { HINSTANCE hInstance = GetModuleHandle(NULL); - HICON mplayericon=NULL; char exedir[MAX_PATH]; WNDCLASS wc; if(arg) @@ -997,7 +1007,7 @@ } } /*load icon from the main app*/ - if(GetModuleFileName(NULL,exedir,MAX_PATH)) + if(!mplayericon && GetModuleFileName(NULL,exedir,MAX_PATH)) { mplayericon = ExtractIcon( hInstance, exedir, 0 ); } @@ -1006,6 +1016,8 @@ monitor_rect.bottom=GetSystemMetrics(SM_CYSCREEN); windowcolor = vo_colorkey; + if (!colorbrush) colorbrush = CreateSolidBrush(windowcolor); + if (!blackbrush) blackbrush = (HBRUSH)GetStockObject(BLACK_BRUSH); wc.style = CS_HREDRAW | CS_VREDRAW; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; @@ -1013,7 +1025,7 @@ wc.hInstance = hInstance; wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = mplayericon; - wc.hbrBackground = CreateSolidBrush(vidmode?RGB(0,0,0):windowcolor); + wc.hbrBackground = vidmode ? blackbrush : colorbrush; wc.lpszClassName = "MPlayer - The Movie Player"; wc.lpszMenuName = NULL; RegisterClass(&wc); @@ -1022,7 +1034,7 @@ hWnd = CreateWindowEx(vidmode?WS_EX_TOPMOST:0, "MPlayer - The Movie Player","",(vidmode)?WS_POPUP:WS_OVERLAPPEDWINDOW| WS_SIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,NULL,NULL,hInstance,NULL); - wc.hbrBackground = CreateSolidBrush(RGB(0,0,0)); + wc.hbrBackground = blackbrush; wc.lpszClassName = "MPlayer - Fullscreen"; RegisterClass(&wc);