summaryrefslogtreecommitdiffstats
path: root/libvo/x11_common.c
diff options
context:
space:
mode:
authorpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-08 12:17:03 +0000
committerpontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-05-08 12:17:03 +0000
commit8ffaf8a85e22704616b16e4c489fe8cb471fcf13 (patch)
tree19d25d4b6156ba0c3dacf9a2cadd95832ee77515 /libvo/x11_common.c
parent1350b62e4a4241dc99465179333e1b830309f225 (diff)
downloadmpv-8ffaf8a85e22704616b16e4c489fe8cb471fcf13.tar.bz2
mpv-8ffaf8a85e22704616b16e4c489fe8cb471fcf13.tar.xz
add gui support
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@724 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/x11_common.c')
-rw-r--r--libvo/x11_common.c69
1 files changed, 50 insertions, 19 deletions
diff --git a/libvo/x11_common.c b/libvo/x11_common.c
index afbfd4ad05..2a6e25f949 100644
--- a/libvo/x11_common.c
+++ b/libvo/x11_common.c
@@ -149,6 +149,17 @@ void vo_x11_decoration( Display * vo_Display,Window w,int d )
}
}
+#ifdef HAVE_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; }
+#endif
+
int vo_x11_check_events(Display *mydisplay){
int ret=0;
XEvent Event;
@@ -157,26 +168,46 @@ int vo_x11_check_events(Display *mydisplay){
XComposeStatus stat;
// unsigned long vo_KeyTable[512];
- 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;
+#ifdef HAVE_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;
+ }
+ }
+#ifdef HAVE_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;
}