summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-17 01:22:09 +0000
committerarpi_esp <arpi_esp@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-06-17 01:22:09 +0000
commit9e90ab54309dcdb720ef8a70e11db90b1ddb46f0 (patch)
treeca25178f2f9b6b95d78c487f2254ca750aa06f81 /libvo
parent255ab08f9d1ae90c541b9ccab12fa55cf3304f6a (diff)
downloadmpv-9e90ab54309dcdb720ef8a70e11db90b1ddb46f0.tar.bz2
mpv-9e90ab54309dcdb720ef8a70e11db90b1ddb46f0.tar.xz
patch: some X11 compliance fixed: set ClassHint and better fullscreen mode
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1138 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_3dfx.c1
-rw-r--r--libvo/vo_gl.c2
-rw-r--r--libvo/vo_x11.c14
-rw-r--r--libvo/vo_xmga.c1
-rw-r--r--libvo/vo_xv.c1
-rw-r--r--libvo/x11_common.c27
-rw-r--r--libvo/x11_common.h1
7 files changed, 40 insertions, 7 deletions
diff --git a/libvo/vo_3dfx.c b/libvo/vo_3dfx.c
index a0012ee38b..d9f3419c0d 100644
--- a/libvo/vo_3dfx.c
+++ b/libvo/vo_3dfx.c
@@ -188,6 +188,7 @@ create_window(Display *display)
mywindow = XCreateWindow(display, RootWindow(display,screen),
hint.x, hint.y, hint.width, hint.height, 4, bpp,CopyFromParent,vinfo.visual,xswamask,&xswa);
+ vo_x11_classhint( display,mywindow,"3dfx" );
XSelectInput(display, mywindow, StructureNotifyMask);
diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 854de2614d..a57fa5af57 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -183,6 +183,8 @@ init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint3
mywindow = XCreateWindow(mydisplay, RootWindow(mydisplay,screen),
hint.x, hint.y, hint.width, hint.height, 4, vinfo->depth,CopyFromParent,vinfo->visual,xswamask,&xswa);
+
+ vo_x11_classhint( mydisplay,mywindow,"gl" );
vo_hidecursor(mydisplay,mywindow);
wsGLXContext=glXCreateContext( mydisplay,vinfo,NULL,True );
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index 82567ecab9..41ef08c857 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -117,6 +117,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
{
// int screen;
int fullscreen=0;
+ int vm=0;
// int interval, prefer_blank, allow_exp, nothing;
unsigned int fg,bg;
char *hello=( title == NULL ) ? "X11 render" : title;
@@ -141,11 +142,12 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
hint.width=image_width;
hint.height=image_height;
- if( flags&0x01 ) fullscreen = 1;
+ if( flags&0x03 ) fullscreen = 1;
+ if( flags&0x02 ) vm = 1;
if( flags&0x08 ) Flip_Flag = 1;
#ifdef HAVE_XF86VM
- if (fullscreen) {
+ if (vm) {
unsigned int modeline_width, modeline_height, vm_event, vm_error;
unsigned int vm_ver, vm_rev;
int i,j,have_vm=0,X,Y;
@@ -221,6 +223,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
hint.x,hint.y,
hint.width,hint.height,
xswa.border_pixel,depth,CopyFromParent,vinfo.visual,xswamask,&xswa );
+ vo_x11_classhint( mDisplay,mywindow,"x11" );
vo_hidecursor(mDisplay,mywindow);
if ( fullscreen ) vo_x11_decoration( mDisplay,mywindow,0 );
@@ -315,7 +318,7 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
bpp=myximage->bits_per_pixel;
- printf( "X11 color mask: R:%lX G:%lX B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
+// printf( "X11 color mask: R:%lX G:%lX B:%lX\n",myximage->red_mask,myximage->green_mask,myximage->blue_mask );
// If we have blue in the lowest bit then obviously RGB
mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_RGB : MODE_BGR;
@@ -325,8 +328,9 @@ static uint32_t init( uint32_t width,uint32_t height,uint32_t d_width,uint32_t d
if ( myximage->byte_order != LSBFirst )
#endif
{
- printf( "No support fon non-native XImage byte order!\n" );
- return -1;
+ mode=( ( myximage->blue_mask & 0x01 ) != 0 ) ? MODE_BGR : MODE_RGB;
+// printf( "No support fon non-native XImage byte order!\n" );
+// return -1;
}
if( format==IMGFMT_YV12 ) yuv2rgb_init( ( depth == 24 ) ? bpp : depth,mode );
diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c
index 5da9a6be53..2969917619 100644
--- a/libvo/vo_xmga.c
+++ b/libvo/vo_xmga.c
@@ -273,6 +273,7 @@ static uint32_t init( uint32_t width, uint32_t height, uint32_t d_width, uint32_
mDepth,
InputOutput,
vinfo.visual,xswamask,&xWAttribs );
+ vo_x11_classhint( mDisplay,mWindow,"xmga" );
vo_hidecursor(mDisplay,mWindow);
if ( mFullscreen ) vo_x11_decoration( mDisplay,mWindow,0 );
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 07e540ff47..2d3a9e25a8 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -141,6 +141,7 @@ static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t
mywindow = XCreateWindow(mDisplay, RootWindow(mDisplay,mScreen),
hint.x, hint.y, hint.width, hint.height,
0, depth,CopyFromParent,vinfo.visual,xswamask,&xswa);
+ vo_x11_classhint( mDisplay,mywindow,"xv" );
vo_hidecursor(mDisplay,mywindow);
XSelectInput(mDisplay, mywindow, StructureNotifyMask | KeyPressMask );
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index 9d4f30dea9..5e5180f0dd 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -49,6 +49,7 @@ int vo_init( void )
{
// int mScreen;
int bpp;
+ unsigned int mask;
// char * DisplayName = ":0.0";
// Display * mDisplay;
XImage * mXImage;
@@ -78,12 +79,19 @@ int vo_init( void )
// get bits/pixel:
mXImage=XGetImage( mDisplay,mRootWin,0,0,1,1,AllPlanes,ZPixmap );
bpp=mXImage->bits_per_pixel;
+ if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
+ mask=mXImage->red_mask|mXImage->green_mask|mXImage->blue_mask;
+ printf("vo: X11 color mask: %X (R:%lX G:%lX B:%lX)\n",
+ mask,mXImage->red_mask,mXImage->green_mask,mXImage->blue_mask);
+ if(((vo_depthonscreen+7)/8)==2){
+ if(mask==0x7FFF) vo_depthonscreen=15; else
+ if(mask==0xFFFF) vo_depthonscreen=16;
+ }
XDestroyImage( mXImage );
- if((vo_depthonscreen+7)/8 != (bpp+7)/8) vo_depthonscreen=bpp; // by A'rpi
// XCloseDisplay( mDisplay );
#warning Better local display detection method is needed.
if (*mDisplayName==':') mLocalDisplay=1; else mLocalDisplay=0;
- printf("X11 running at %dx%d depth: %d (\"%s\" => %s display)\n",vo_screenwidth,vo_screenheight,vo_depthonscreen,mDisplayName,mLocalDisplay?"local":"remote");
+ printf("vo: X11 running at %dx%d depth: %d (\"%s\" => %s display)\n",vo_screenwidth,vo_screenheight,vo_depthonscreen,mDisplayName,mLocalDisplay?"local":"remote");
return 1;
}
@@ -149,6 +157,14 @@ static Atom vo_MotifHints = None;
void vo_x11_decoration( Display * vo_Display,Window w,int d )
{
+
+#if 1
+ XSetWindowAttributes attr;
+ attr.override_redirect = True;
+ XChangeWindowAttributes(vo_Display, w, CWOverrideRedirect, &attr);
+// XMapWindow(vo_Display], w);
+#endif
+
vo_MotifHints=XInternAtom( vo_Display,"_MOTIF_WM_HINTS",0 );
if ( vo_MotifHints != None )
{
@@ -159,6 +175,13 @@ void vo_x11_decoration( Display * vo_Display,Window w,int d )
}
}
+void vo_x11_classhint( Display * display,Window window,char *name ){
+ XClassHint wmClass;
+ wmClass.res_name = name;
+ wmClass.res_class = "MPlayer";
+ XSetClassHint(display,window,&wmClass);
+}
+
#ifdef HAVE_GUI
Window vo_window = None;
GC vo_gc;
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index 5a5c7d9f44..575b06d627 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -16,6 +16,7 @@ extern int mLocalDisplay;
int vo_init( void );
int vo_hidecursor ( Display* , Window );
void vo_x11_decoration( Display * vo_Display,Window w,int d );
+void vo_x11_classhint( Display * display,Window window,char *name );
int vo_x11_check_events(Display *mydisplay);
#endif