Mercurial > mplayer.hg
diff libvo/x11_common.c @ 4795:b18e61cb457a
small changes
author | pontscho |
---|---|
date | Thu, 21 Feb 2002 21:11:01 +0000 |
parents | a34682347090 |
children | c39affa2b376 |
line wrap: on
line diff
--- a/libvo/x11_common.c Thu Feb 21 19:41:50 2002 +0000 +++ b/libvo/x11_common.c Thu Feb 21 21:11:01 2002 +0000 @@ -392,19 +392,12 @@ XSetClassHint(display,window,&wmClass); } +Window vo_window = None; +GC vo_gc; + #ifdef HAVE_NEW_GUI - Window vo_window = None; - GC vo_gc; - int vo_xeventhandling = 1; - int vo_resize = 0; - int vo_expose = 0; - void vo_setwindow( Window w,GC g ) { vo_window=w; vo_gc=g; - vo_xeventhandling=0; - } - void vo_setwindowsize( int w,int h ) { - vo_dwidth=w; vo_dheight=h; } #endif @@ -433,57 +426,41 @@ static XComposeStatus stat; // unsigned long vo_KeyTable[512]; -#ifdef HAVE_NEW_GUI - if ( vo_xeventhandling ) - { -#endif - while ( XPending( mydisplay ) ) - { - XNextEvent( mydisplay,&Event ); - switch( Event.type ) - { - case Expose: - ret|=VO_EVENT_EXPOSE; - break; - case ConfigureNotify: - vo_dwidth=Event.xconfigure.width; - vo_dheight=Event.xconfigure.height; - ret|=VO_EVENT_RESIZE; - break; - case KeyPress: - XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); - vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); - ret|=VO_EVENT_KEYPRESS; - break; + while ( XPending( mydisplay ) ) + { + XNextEvent( mydisplay,&Event ); +// #ifdef HAVE_NEW_GUI +// if ( use_gui ) gEvent( 0,(char*)&Event ); +// #endif + if ( vo_window == Event.xany.window ) + switch( Event.type ) + { + case Expose: + ret|=VO_EVENT_EXPOSE; + break; + case ConfigureNotify: + vo_dwidth=Event.xconfigure.width; + vo_dheight=Event.xconfigure.height; + ret|=VO_EVENT_RESIZE; + break; + case KeyPress: + XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); + vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); + ret|=VO_EVENT_KEYPRESS; + break; #ifdef HAVE_NEW_INPUT - case ButtonPress: - // Ignore mouse whell press event - if(Event.xbutton.button == 4 || Event.xbutton.button == 5) - break; - mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN); - break; - case ButtonRelease: - mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); - break; + case ButtonPress: + // Ignore mouse whell press event + if(Event.xbutton.button == 4 || Event.xbutton.button == 5) + break; + mplayer_put_key((MOUSE_BTN0+Event.xbutton.button-1)|MP_KEY_DOWN); + break; + case ButtonRelease: + mplayer_put_key(MOUSE_BTN0+Event.xbutton.button-1); + break; #endif - } - } -#ifdef HAVE_NEW_GUI - } - else - { - if ( vo_resize ) - { - vo_resize=0; - ret|=VO_EVENT_RESIZE; - } - if ( vo_expose ) - { - vo_expose=0; - ret|=VO_EVENT_EXPOSE; - } } -#endif + } return ret; }