summaryrefslogtreecommitdiffstats
path: root/libvo/vo_x11.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-11 14:57:41 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-11 14:57:41 +0000
commite6215bef4078ff772f74e9cad7aa327a5a2b5ef5 (patch)
treee110bbce4ee487a474d7058701fca5aebbd6f2d1 /libvo/vo_x11.c
parenta7c47b7910df660702cae6350c44da07a3c8b5d5 (diff)
downloadmpv-e6215bef4078ff772f74e9cad7aa327a5a2b5ef5.tar.bz2
mpv-e6215bef4078ff772f74e9cad7aa327a5a2b5ef5.tar.xz
fix some small bug and -rootwin
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6044 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_x11.c')
-rw-r--r--libvo/vo_x11.c69
1 files changed, 34 insertions, 35 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 7f89d21448..ba5a79eae3 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -249,7 +249,6 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
static uint32_t vm_height;
#endif
-
vo_mouse_autohide=1;
old_vo_dwidth=-1;
old_vo_dheight=-1;
@@ -261,6 +260,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
if(in_format==IMGFMT_I420 || in_format==IMGFMT_IYUV) in_format=IMGFMT_YV12;
srcW= width;
srcH= height;
+ vo_dx=( vo_screenwidth - d_width ) / 2; vo_dy=( vo_screenheight - d_height ) / 2;
vo_dwidth=width; vo_dheight=height;
if( flags&0x03 ) fullscreen = 1;
@@ -290,15 +290,10 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
else
#endif
{
- hint.x=0;
- hint.y=0;
-// if(zoomFlag){
-// hint.width=d_width;
-// hint.height=d_height;
-// }else{
- hint.width=width;
- hint.height=height;
-// }
+ hint.x=vo_dx;
+ hint.y=vo_dy;
+ hint.width=width;
+ hint.height=height;
#ifdef HAVE_XF86VM
if ( vm )
@@ -313,13 +308,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
hint.width=modeline_width;
hint.height=modeline_height;
}
-// else
#endif
-// if ( fullscreen )
-// {
-// hint.width=vo_screenwidth;
-// hint.height=vo_screenheight;
-// }
hint.flags=PPosition | PSize;
bg=WhitePixel( mDisplay,mScreen );
@@ -344,24 +333,36 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
#endif
if ( WinID>=0 ){
- vo_window = WinID ? ((Window)WinID) : RootWindow( mDisplay,mScreen );
- XUnmapWindow( mDisplay,vo_window );
- XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa );
+ vo_window = WinID ? ((Window)WinID) : mRootWin;
+ if ( WinID )
+ {
+ XUnmapWindow( mDisplay,vo_window );
+ XChangeWindowAttributes( mDisplay,vo_window,xswamask,&xswa );
+ XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask | ExposureMask );
+ } else XSelectInput( mDisplay,vo_window,ExposureMask );
}
else
- vo_window=XCreateWindow( mDisplay,RootWindow( mDisplay,mScreen ),
+ {
+ vo_window=XCreateWindow( mDisplay,mRootWin,
hint.x,hint.y,
hint.width,hint.height,
xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
- vo_x11_classhint( mDisplay,vo_window,"x11" );
- vo_hidecursor(mDisplay,vo_window);
- XSelectInput( mDisplay,vo_window,StructureNotifyMask );
- XSetStandardProperties( mDisplay,vo_window,title,title,None,NULL,0,&hint );
- XMapWindow( mDisplay,vo_window );
- if(WinID!=0)
- do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo_window );
- XSelectInput( mDisplay,vo_window,NoEventMask );
+ vo_x11_classhint( mDisplay,vo_window,"x11" );
+ vo_hidecursor(mDisplay,vo_window);
+ XSelectInput( mDisplay,vo_window,StructureNotifyMask );
+ XSetStandardProperties( mDisplay,vo_window,title,title,None,NULL,0,&hint );
+ XMapWindow( mDisplay,vo_window );
+ if(WinID!=0)
+ do { XNextEvent( mDisplay,&xev ); } while ( xev.type != MapNotify || xev.xmap.event != vo_window );
+ XSelectInput( mDisplay,vo_window,NoEventMask );
+
+ if ( fullscreen ) vo_x11_fullscreen();
+#ifdef HAVE_XINERAMA
+ vo_x11_xinerama_move(mDisplay,vo_window);
+#endif
+ }
+
XFlush( mDisplay );
XSync( mDisplay,False );
@@ -381,13 +382,11 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
#endif
}
- if ( fullscreen ) vo_x11_fullscreen();
-#ifdef HAVE_XINERAMA
- vo_x11_xinerama_move(mDisplay,vo_window);
-#endif
-
- vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
- getMyXImage();
+ vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
+ getMyXImage();
+
+ if ( !WinID )
+ { vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight; }
switch ((bpp=myximage->bits_per_pixel)){
case 24: draw_alpha_fnc=draw_alpha_24;