Mailing List Archive

r19314 - in projects/haf/branches/clutter: . starvation.49/clutter/x11
Author: aendrodi
Date: 2009-09-09 18:40:15 +0300 (Wed, 09 Sep 2009)
New Revision: 19314

Added:
projects/haf/branches/clutter/starvation.49/
Modified:
projects/haf/branches/clutter/starvation.49/clutter/x11/clutter-event-x11.c
Log:
0.8.2-0maemo49 + starvation


Copied: projects/haf/branches/clutter/starvation.49 (from rev 19313, projects/haf/tags/clutter/0.8.2-0maemo49)

Modified: projects/haf/branches/clutter/starvation.49/clutter/x11/clutter-event-x11.c
===================================================================
--- projects/haf/tags/clutter/0.8.2-0maemo49/clutter/x11/clutter-event-x11.c 2009-09-09 15:36:57 UTC (rev 19313)
+++ projects/haf/branches/clutter/starvation.49/clutter/x11/clutter-event-x11.c 2009-09-09 15:40:15 UTC (rev 19314)
@@ -816,9 +816,16 @@
Display *xdisplay = backend_x11->xdpy;
XEvent xevent;
ClutterMainContext *clutter_context;
+ static GTimer *timer;

clutter_context = clutter_context_get_default ();

+ /* Observe the elapsed time we spend on event processing not to starve
+ * g_timeout_add() callbacks to death. */
+ if (!timer)
+ timer = g_timer_new ();
+ g_timer_start (timer);
+
while (!clutter_events_pending () && XPending (xdisplay))
{
XNextEvent (xdisplay, &xevent);
@@ -834,6 +841,10 @@
{
clutter_event_free (event);
}
+
+ /* Take a break every 40 milisecs. */
+ if (g_timer_elapsed (timer, NULL) >= 0.04)
+ break;
}
}


_______________________________________________
maemo-commits mailing list
maemo-commits@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-commits