[maemo-commits] [maemo-commits] r19314 - in projects/haf/branches/clutter: . starvation.49/clutter/x11
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Wed Sep 9 18:40:23 EEST 2009
- Previous message: [maemo-commits] r19313 - in projects/haf/branches/libmatchbox2: . bug.134557.nivea2/matchbox/core
- Next message: [maemo-commits] r19315 - projects/haf/branches/clutter/starvation.49/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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;
}
}
- Previous message: [maemo-commits] r19313 - in projects/haf/branches/libmatchbox2: . bug.134557.nivea2/matchbox/core
- Next message: [maemo-commits] r19315 - projects/haf/branches/clutter/starvation.49/debian
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
