summaryrefslogtreecommitdiffstats
path: root/Gui
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-25 23:18:17 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-08-25 23:18:17 +0000
commitce8520a39b1a3a116c31e7fb74a1da319df9212d (patch)
tree69401e483157c503a620ba7798133a75963d8cf4 /Gui
parentfcaa694b6de5e223d686f5d479fc5f763ac2bdbb (diff)
downloadmpv-ce8520a39b1a3a116c31e7fb74a1da319df9212d.tar.bz2
mpv-ce8520a39b1a3a116c31e7fb74a1da319df9212d.tar.xz
DGA2 ifdefs, new mainloop/timer stuff
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1700 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui')
-rw-r--r--Gui/wm/ws.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/Gui/wm/ws.c b/Gui/wm/ws.c
index 49122e8500..a36476e79a 100644
--- a/Gui/wm/ws.c
+++ b/Gui/wm/ws.c
@@ -149,20 +149,24 @@ void wsXInit( void )
fprintf( stderr,"[ws] sorry, your system is not supported X shared memory extension.\n" );
wsUseXShm=0;
}
-// if ( !XDGAQueryExtension( wsDisplay,&eventbase,&errorbase ) )
+#ifdef HAVE_DGA2
+ if ( !XDGAQueryExtension( wsDisplay,&eventbase,&errorbase ) )
{
fprintf( stderr,"[ws] sorry, your system is not supported DGA extension.\n" );
wsUseDGA=0;
}
- #ifdef HAVE_XSHAPE
+#else
+ wsUseDGA=0;
+#endif
+#ifdef HAVE_XSHAPE
if ( !XShapeQueryExtension( wsDisplay,&eventbase,&errorbase ) )
{
fprintf( stderr,"[ws] sorry, your system is not supported XShape extension.\n" );
wsUseXShape=0;
}
- #else
+#else
wsUseXShape=0;
- #endif
+#endif
XSynchronize( wsDisplay,True );
@@ -172,7 +176,7 @@ void wsXInit( void )
wsMaxY=DisplayHeight( wsDisplay,wsScreen );
wsGetDepthOnScreen();
- #ifdef DEBUG
+#ifdef DEBUG
{
int minor,major,shp;
fprintf( stderr,"[ws] Screen depth: %d\n",wsDepthOnScreen );
@@ -184,11 +188,11 @@ void wsXInit( void )
XShmQueryVersion( wsDisplay,&major,&minor,&shp );
fprintf( stderr,"[ws] XShm version is %d.%d\n",major,minor );
}
- if ( wsUseDGA )
- {
+// if ( wsUseDGA )
+// {
// XDGAQueryVersion( wsDisplay,&major,&minor );
// fprintf( stderr,"[ws] DGA version is %d.%d\n",major,minor );
- }
+// }
#ifdef HAVE_XSHAPE
if ( wsUseXShape )
{
@@ -197,7 +201,7 @@ void wsXInit( void )
}
#endif
}
- #endif
+#endif
initConverter();
wsOutMask=wsGetOutMask();
switch ( wsOutMask )
@@ -629,15 +633,36 @@ Bool wsDummyEvents( Display * display,XEvent * Event,XPointer arg )
void wsMainLoop( void )
{
+ int delay=20;
fprintf( stderr,"[ws] init threads: %d\n",XInitThreads() );
XSynchronize( wsDisplay,False );
XLockDisplay( wsDisplay );
// XIfEvent( wsDisplay,&wsEvent,wsEvents,NULL );
+
+#if 1
+
+while(wsTrue){
+ // handle pending events
+ while ( XPending(wsDisplay) ){
+ XNextEvent( wsDisplay,&wsEvent );
+ printf("### X event: %d [%d]\n",wsEvent.type,delay);
+ wsEvents( wsDisplay,&wsEvent,NULL );
+ delay=20;
+ }
+ mplTimerHandler(0); // handle timer event
+ usleep(delay*1000); // FIXME!
+ if(delay<8*20) delay+=20; // pump up delay up to 0.16 sec (low activity)
+}
+
+#else
+
while( wsTrue )
{
XIfEvent( wsDisplay,&wsEvent,wsDummyEvents,NULL );
wsEvents( wsDisplay,&wsEvent,NULL );
}
+#endif
+
XUnlockDisplay( wsDisplay );
}