summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-25 21:52:47 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-25 21:52:47 +0000
commit51f5418bd80fb91a77561387b4471c5d80a50434 (patch)
tree84398651ca37944e9a7de1f33f2b86f0d251c7b8 /libvo
parent0b903395b51e5c6471660138c794643fe90d0f9d (diff)
downloadmpv-51f5418bd80fb91a77561387b4471c5d80a50434.tar.bz2
mpv-51f5418bd80fb91a77561387b4471c5d80a50434.tar.xz
fix fullscreen (?)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5836 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_x11.c2
-rw-r--r--libvo/vo_xmga.c3
-rw-r--r--libvo/vo_xv.c2
-rw-r--r--libvo/x11_common.c38
-rw-r--r--libvo/x11_common.h2
5 files changed, 30 insertions, 17 deletions
diff --git a/libvo/vo_x11.c b/libvo/vo_x11.c
index aae5163b9d..7ed64e68ab 100644
--- a/libvo/vo_x11.c
+++ b/libvo/vo_x11.c
@@ -362,7 +362,7 @@ static uint32_t config( uint32_t width,uint32_t height,uint32_t d_width,uint32_t
vo_gc=XCreateGC( mDisplay,vo_window,0L,&xgcv );
// we cannot grab mouse events on root window :(
- XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask |
+ XSelectInput( mDisplay,vo_window,StructureNotifyMask | KeyPressMask | PropertyChangeMask |
((WinID==0)?0:(ButtonPressMask | ButtonReleaseMask | PointerMotionMask)) );
#ifdef HAVE_XF86VM
diff --git a/libvo/vo_xmga.c b/libvo/vo_xmga.c
index 00c9eba3c2..bac450a198 100644
--- a/libvo/vo_xmga.c
+++ b/libvo/vo_xmga.c
@@ -278,7 +278,7 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
xWAttribs.colormap=XCreateColormap( mDisplay,RootWindow( mDisplay,mScreen ),vinfo.visual,AllocNone );
xWAttribs.background_pixel=0;
xWAttribs.border_pixel=0;
- xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask |
+ xWAttribs.event_mask=StructureNotifyMask | ExposureMask | KeyPressMask | PropertyChangeMask |
((WinID==0)?0:(ButtonPressMask | ButtonReleaseMask | PointerMotionMask));
xswamask=CWBackPixel | CWBorderPixel | CWColormap | CWEventMask;
@@ -296,7 +296,6 @@ static uint32_t config( uint32_t width, uint32_t height, uint32_t d_width, uint3
vinfo.visual,xswamask,&xWAttribs );
vo_x11_classhint( mDisplay,vo_window,"xmga" );
vo_hidecursor(mDisplay,vo_window);
- vo_x11_sizehint( wndX,wndY,wndWidth,wndHeight );
if ( vo_fs ) vo_x11_decoration( mDisplay,vo_window,0 );
diff --git a/libvo/vo_xv.c b/libvo/vo_xv.c
index 6b93bcd2c1..ff64a3ee29 100644
--- a/libvo/vo_xv.c
+++ b/libvo/vo_xv.c
@@ -417,7 +417,7 @@ static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width, uint32
vo_x11_classhint( mDisplay,vo_window,"xv" );
vo_hidecursor(mDisplay,vo_window);
- XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask |
+ XSelectInput(mDisplay, vo_window, StructureNotifyMask | KeyPressMask | PropertyChangeMask |
((WinID==0) ? 0 : (PointerMotionMask
#ifdef HAVE_NEW_INPUT
| ButtonPressMask | ButtonReleaseMask
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index e6a2d66b95..5d80e699bd 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -453,6 +453,7 @@ int vo_x11_uninit(Display *display, Window window)
int vo_mouse_timer_const = 30;
static int vo_mouse_counter = 30;
+ int vo_wm_type = 1;
int vo_x11_check_events(Display *mydisplay){
int ret=0;
@@ -497,8 +498,9 @@ int vo_x11_check_events(Display *mydisplay){
&vo_dx, &vo_dy, (Window *)&foo);
}
#endif
- if (verbose)
+// if (verbose)
printf("X11 Window %dx%d-%dx%d\n", vo_dx, vo_dy, vo_dwidth, vo_dheight);
+ printf("============================================================\n" );
ret|=VO_EVENT_RESIZE;
break;
case KeyPress:
@@ -539,32 +541,42 @@ int vo_x11_check_events(Display *mydisplay){
mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
break;
#endif
+ case PropertyNotify:
+ if ( !strcmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"_ICEWM_TRAY" ) ||
+ !strncmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"_KDE_",5 ) ||
+ !strcmp( XGetAtomName( mydisplay,Event.xproperty.atom ),"KWM_WIN_DESKTOP" ) ) vo_wm_type=0;
+
+ fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",
+ vo_window,XGetAtomName( mydisplay,Event.xproperty.atom ),Event.xproperty.atom );
+
+ break;
}
}
return ret;
}
-void vo_x11_sizehint( int x, int y, int width, int height )
+void vo_x11_sizehint( int x, int y, int width, int height, int max )
{
- vo_hint.flags=PPosition | PSize | PWinGravity;
+ vo_hint.flags=PPosition | PSize | PWinGravity | PBaseSize;
vo_hint.x=x; vo_hint.y=y; vo_hint.width=width; vo_hint.height=height;
+ if ( max )
+ {
+ vo_hint.max_width=width; vo_hint.max_height=height;
+ vo_hint.flags|=PMaxSize;
+ } else { vo_hint.max_width=0; vo_hint.max_height=0; }
+ vo_hint.base_width=width; vo_hint.base_height=height;
vo_hint.win_gravity=StaticGravity;
XSetWMNormalHints( mDisplay,vo_window,&vo_hint );
}
void vo_x11_fullscreen( void )
{
- XUnmapWindow( mDisplay,vo_window );
+ if ( vo_wm_type ) XUnmapWindow( mDisplay,vo_window );
if ( !vo_fs )
{
vo_fs=VO_TRUE;
vo_old_x=vo_dx; vo_old_y=vo_dy; vo_old_width=vo_dwidth; vo_old_height=vo_dheight;
-// {
-// Window root; int foo, foo2;
-// XGetGeometry( mDisplay,vo_window,&root,&vo_old_x,&vo_old_y,&vo_old_width,vo_old_height,&foo,&foo2 );
-// XTranslateCoordinates( mDisplay,vo_window,root,0,0,&vo_old_x,&vo_old_y,(Window *)&foo);
-// }
vo_dx=0; vo_dy=0; vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight;
vo_x11_decoration( mDisplay,vo_window,0 );
}
@@ -574,10 +586,12 @@ void vo_x11_fullscreen( void )
vo_dx=vo_old_x; vo_dy=vo_old_y; vo_dwidth=vo_old_width; vo_dheight=vo_old_height;
vo_x11_decoration( mDisplay,vo_window,1 );
}
- vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight );
+ vo_x11_sizehint( vo_dx,vo_dy,vo_dwidth,vo_dheight,0 );
XMoveResizeWindow( mDisplay,vo_window,vo_dx,vo_dy,vo_dwidth,vo_dheight );
- XMapWindow( mDisplay,vo_window );
- XSync( mDisplay,False );
+ XMapRaised( mDisplay,vo_window );
+
+ XRaiseWindow( mDisplay,vo_window );
+ XFlush( mDisplay );
}
void saver_on(Display *mDisplay) {
diff --git a/libvo/x11_common.h b/libvo/x11_common.h
index 0f7d7f9ef8..dac907dec8 100644
--- a/libvo/x11_common.h
+++ b/libvo/x11_common.h
@@ -28,7 +28,7 @@ int vo_hidecursor ( Display* , Window );
extern void vo_showcursor( Display *disp, Window win );
void vo_x11_decoration( Display * vo_Display,Window w,int d );
void vo_x11_classhint( Display * display,Window window,char *name );
-void vo_x11_sizehint( int x, int y, int width, int height );
+void vo_x11_sizehint( int x, int y, int width, int height, int max );
int vo_x11_check_events(Display *mydisplay);
void vo_x11_fullscreen( void );
#endif