From 7ab3a9ffdb889c57dfc4b73b8bf26ebb8d1dc5b8 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 12 Sep 2005 00:47:03 +0000 Subject: try Jason Tackaberry suggestion to fix problem of the growing X event queue with increased CPU load (that is, some events were never dequeued) CVS patchset: 7729 CVS date: 2005/09/12 00:47:03 --- doc/hackersguide/library.sgml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'doc') diff --git a/doc/hackersguide/library.sgml b/doc/hackersguide/library.sgml index 07aaf3cc0..1d987d259 100644 --- a/doc/hackersguide/library.sgml +++ b/doc/hackersguide/library.sgml @@ -264,14 +264,16 @@ int main(int argc, char **argv) { XEvent xevent; int got_event; - xine_usec_sleep(20000); - XLockDisplay(display); - got_event = XCheckMaskEvent(display, INPUT_MOTION, &xevent); + got_event = XPending(display); + if( got_event ) + XNextEvent(display, &xevent); XUnlockDisplay(display); - if( !got_event ) + if( !got_event ) { + xine_usec_sleep(20000); continue; + } switch(xevent.type) { -- cgit v1.2.3