--- original/libvo/vo_directx.c Sun Feb 5 09:41:53 2006 +++ kj/libvo/vo_directx.c Tue Feb 7 21:12:46 2006 @@ -79,6 +79,7 @@ static RECT monitor_rect; //monitor coordinates static float window_aspect; static BOOL (WINAPI* myGetMonitorInfo)(HMONITOR, LPMONITORINFO) = NULL; +static RECT last_rect = {0xDEADC0DE, 0xDEADC0DE, 0xDEADC0DE, 0xDEADC0DE}; extern void mplayer_put_key(int code); //let mplayer handel the keyevents extern void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); @@ -435,6 +436,9 @@ return 1; } + // clear last window position + last_rect.left = last_rect.top = last_rect.right = last_rect.bottom = 0xDEADC0DE; + if(vo_adapter_num){ //display other than default OurDirectDrawEnumerateEx = (LPDIRECTDRAWENUMERATEEX) GetProcAddress(hddraw_dll,"DirectDrawEnumerateExA"); if (!OurDirectDrawEnumerateEx){ @@ -532,6 +536,17 @@ DWORD dwUpdateFlags=0; int width,height; + if(!vidmode && !vo_fs && WinID!=-1) { + RECT current_rect = {0, 0, 0, 0}; + GetWindowRect(hWnd, ¤t_rect); + if ((current_rect.left == last_rect.left) + && (current_rect.top == last_rect.top) + && (current_rect.right == last_rect.right) + && (current_rect.bottom == last_rect.bottom)) + return 0; + last_rect = current_rect; + } + if(vo_fs || vidmode){ aspect(&width,&height,A_ZOOM); rd.left=(vo_screenwidth-width)/2;