From 210f7955fbb02723a60864cc38a4436528b544d9 Mon Sep 17 00:00:00 2001 From: pontscho Date: Wed, 16 Oct 2002 21:32:03 +0000 Subject: [PATCH] -fixed-vo support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7764 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 1f52096d1c..5a2b155a3a 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -669,13 +669,9 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin xswa.colormap = XCreateColormap(mDisplay, mRootWin, vinfo->visual, AllocNone); xswamask = CWBackPixel | CWBorderPixel | CWColormap; - vo_window = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), - hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa); - - vo_x11_classhint( mDisplay,vo_window,"gl2" ); - vo_hidecursor(mDisplay,vo_window); - - wsGLXContext=glXCreateContext( mDisplay,vinfo,NULL,True ); + if ( vo_window == None ) + { + vo_window = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen), hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa); if ( flags&0x01 ) vo_x11_decoration( mDisplay,vo_window,0 ); @@ -686,7 +682,6 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin XSetStandardProperties(mDisplay, vo_window, hello, hello, None, NULL, 0, &hint); /* Map window. */ - XMapWindow(mDisplay, vo_window); #ifdef HAVE_XINERAMA vo_x11_xinerama_move(mDisplay,vo_window); @@ -702,7 +697,17 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin XSelectInput(mDisplay, vo_window, NoEventMask); - glXMakeCurrent( mDisplay,vo_window,wsGLXContext ); + } + else if ( !(flags&1) ) XMoveResizeWindow( mDisplay,vo_window,hint.x,hint.y,hint.width,hint.height ); + + vo_x11_classhint( mDisplay,vo_window,"gl2" ); + vo_hidecursor(mDisplay,vo_window); + + if ( vo_config_count ) glXDestroyContext( mDisplay,wsGLXContext ); + + wsGLXContext=glXCreateContext( mDisplay,vinfo,NULL,True ); + + glXMakeCurrent( mDisplay,vo_window,wsGLXContext ); XFlush(mDisplay); XSync(mDisplay, False);