summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-11 17:21:32 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-05-11 17:21:32 +0000
commitefe7c39f834fb9bb7b55036cf404a2eb9183eb92 (patch)
treea4d10458ce6aa24c24d1e863bfc8e44d07234138 /libvo
parentfc7a24a48326aa0136fc394b2ff4a435de13d2ca (diff)
downloadmpv-efe7c39f834fb9bb7b55036cf404a2eb9183eb92.tar.bz2
mpv-efe7c39f834fb9bb7b55036cf404a2eb9183eb92.tar.xz
remove base size from vo_x11_sizehint
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6047 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/x11_common.c50
1 files changed, 21 insertions, 29 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index ddb47f9a61..5c43f6a749 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -175,6 +175,18 @@ static void x11_errorhandler(Display *display, XErrorEvent *event)
#undef MSGLEN
}
+int vo_wm_string_test( char * name )
+{
+ if ( !strncmp( name,"_ICEWM_TRAY",11 ) )
+ { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is IceWM.\n" ); return vo_wm_IceWM; }
+ if ( !strncmp( name,"_KDE_",5 ) )
+ { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is KDE.\n" ); return vo_wm_KDE; }
+ if ( !strncmp( name,"KWM_WIN_DESKTOP",15 ) )
+ { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is WindowMaker style.\n" ); return vo_wm_WMakerStyle; }
+// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",win,name,xev.xproperty.atom );
+ return vo_wm_Unknown;
+}
+
int vo_wm_detect( void )
{
Atom type;
@@ -214,14 +226,8 @@ int vo_wm_detect( void )
name=XGetAtomName( mDisplay,xev.xproperty.atom );
if ( !name ) break;
- if ( !strncmp( name,"_ICEWM_TRAY",11 ) )
- { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is IceWM.\n" ); wm=vo_wm_IceWM; break; }
- if ( !strncmp( name,"_KDE_",5 ) )
- { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is KDE.\n" ); wm=vo_wm_KDE; break; }
- if ( !strncmp( name,"KWM_WIN_DESKTOP",15 ) )
- { mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is WindowMaker style.\n" ); wm=vo_wm_WMakerStyle; break; }
-// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",win,name,xev.xproperty.atom );
-
+ wm=vo_wm_string_test( name );
+ if ( wm != vo_wm_Unknown ) break;
XFree( name ); name=NULL;
}
} while( c++ < 25 );
@@ -620,34 +626,21 @@ int vo_x11_check_events(Display *mydisplay){
mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1);
break;
#endif
-#if 1
case PropertyNotify:
{
char * name = XGetAtomName( mydisplay,Event.xproperty.atom );
+ int wm = vo_wm_Unknown;
+
if ( !name ) break;
- if ( !strncmp( name,"_ICEWM_TRAY",11 ) )
- {
- mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is IceWM.\n" );
- vo_wm_type=vo_wm_IceWM;
- }
- if ( !strncmp( name,"_KDE_",5 ) )
- {
- mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is KDE.\n" );
- vo_wm_type=vo_wm_KDE;
- }
- if ( !strncmp( name,"KWM_WIN_DESKTOP",15 ) )
- {
- mp_dbg( MSGT_VO,MSGL_STATUS,"[x11] Detected wm is WindowMaker style.\n" );
- vo_wm_type=vo_wm_WMakerStyle;
- }
-
-// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",vo_window,name,Event.xproperty.atom );
+ wm=vo_wm_string_test(name);
+ if ( wm != vo_wm_Unknown ) vo_wm_type=wm;
+
+// fprintf(stderr,"[ws] PropertyNotify ( 0x%x ) %s ( 0x%x )\n",vo_window,name,Event.xproperty.atom );
XFree( name );
}
break;
-#endif
}
}
return ret;
@@ -655,14 +648,13 @@ int vo_x11_check_events(Display *mydisplay){
void vo_x11_sizehint( int x, int y, int width, int height, int max )
{
- vo_hint.flags=PPosition | PSize | PWinGravity | PBaseSize;
+ vo_hint.flags=PPosition | PSize | PWinGravity;
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 );
}