From dad823f123b9e82d685201ad367187634077e3a0 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 6 Dec 2007 12:38:04 +0000 Subject: [PATCH] 2007-12-06 Emmanuele Bassi * clutter/clutter-main.c: (clutter_set_motion_events_frequency): Never allow the motion events devlivery frequency to exceed the default frame rate. --- ChangeLog | 6 ++++++ clutter/clutter-main.c | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8eac34e3..96821fe0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-12-06 Emmanuele Bassi + + * clutter/clutter-main.c: + (clutter_set_motion_events_frequency): Never allow the motion + events devlivery frequency to exceed the default frame rate. + 2007-12-06 Emmanuele Bassi * clutter/json/json-parser.[ch]: Use gssize, size we allow -1 diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 2a17981ff..0da0053ce 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -1780,7 +1780,8 @@ clutter_get_motion_events_frequency (void) /** * clutter_set_motion_events_frequency: - * @frequency: the number of motion events per second + * @frequency: the number of motion events per second, or 0 for the + * default value * * Sets the motion events frequency. Setting this to a non-zero value * will override the default setting, so it should be rarely used. @@ -1798,5 +1799,6 @@ clutter_set_motion_events_frequency (guint frequency) { ClutterMainContext *context = clutter_context_get_default (); - context->motion_frequency = frequency; + /* never allow the motion events to exceed the default frame rate */ + context->motion_frequency = CLAMP (frequency, 1, clutter_default_fps); }