All pastes #1338469 Raw Edit

liqbase flicker problem

public c v1 · immutable
#1338469 ·published 2009-02-15 23:53 UTC
rendered paste body
		// 20090215:gb: hmmm, flicker problem		// serious graphical overwriting and flicker ensue when fullspeed refreshing when idle mainly		// (fullspeed refreshing is drawing a series of live scenes as fast as possible only waiting for refreshed event)		// but often with other random stuff		// sometimes however its rock solid stable and works perfectly		// is x11 native update interupting the stream from xv i wonder		// 20090215:gb: ok, this got weird quickly		// in the event handler above, I have a LIQEVENT_TYPE_REFRESHED event		// which comes internally from the XShmCompletionEvent event raised sometime after calling XvShmPutImage()		// if I register the completion above and loop back round into while(liqcanvas_eventcount())		// then the flickering occurs.		// if I add a "break;" to the specific Refreshed handler and exit the loop without		// calling liqcanvas_eventcount() again until i have already drawn the screen		// then there is no flicker.		// VERY strange, following into liqcanvas_eventcount() now ...		// this calls liqcanvas_xv_eventcount() to directly handle the maemo events		// which as its only code line is: int evc=XEventsQueued(dpy, QueuedAfterFlush);		// is this line telling the system they CAN run now, yealding, ie a "doevents()" ????		// a process is then starting and we are colliding for use of the framebuffer		// there is no spinlock in interface use.				// marked as solved for future reference				// this is the basic event loop:				// while(running)		// {		//		while(XEventsQueued())		// 		{		// 			// handle events		//			XNextEvent()		// 			case MOUSE/KEY etc		//			case XShmCompletionEvent		// 				oktodraw=true;		// 				break;                         <<< adding or removing this caused or removed the flicker            		// 		}		// 		if(oktodraw)		// 		{		//			DrawFrame();		//	 	  	XvShmPutImage();		//		}		// }