diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-21 21:11:01 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-02-21 21:11:01 +0000 |
commit | 57e3534b047dd6168aa5c01ce4773779220c5d06 (patch) | |
tree | fb29b6a58a56bd616f990cb136ee5db9b8a16df8 /libvo/x11_common.c | |
parent | d42410163154e4b3413d18409826145d63a5a254 (diff) | |
download | mpv-57e3534b047dd6168aa5c01ce4773779220c5d06.tar.bz2 mpv-57e3534b047dd6168aa5c01ce4773779220c5d06.tar.xz |
small changes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4796 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r-- | libvo/x11_common.c | 93 |
1 files changed, 35 insertions, 58 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 6b04756aaf..beab7d4f90 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -392,19 +392,12 @@ void vo_x11_classhint( Display * display,Window window,char *name ){ XSetClassHint(display,window,&wmClass); } -#ifdef HAVE_NEW_GUI - Window vo_window = None; - GC vo_gc; - int vo_xeventhandling = 1; - int vo_resize = 0; - int vo_expose = 0; +Window vo_window = None; +GC vo_gc; +#ifdef HAVE_NEW_GUI 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 @@ int vo_x11_check_events(Display *mydisplay){ 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; } |