2008-05-07 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/sdl/clutter-backend-sdl.c:
	(clutter_backend_sdl_dispose): Destroy the timer that we created...
	(clutter_backend_sdl_init): ... here.

	* clutter/sdl/clutter-backend-sdl.h: Add a GTimer for time-based
	operations, like the event time.

	* clutter/sdl/clutter-event-sdl.c:
	(get_backend_time): Get the elapsed milliseconds for the SDL
	backend.

	(_clutter_events_init): Start the timer provided by the backend...
	(_clutter_events_uninit): ... and the stop it.

	(key_event_translate), (event_translate): Use the backend time
	to fill out the time field of the event structures. This fixes
	the motion notification throttling on the SDL backend.
This commit is contained in:
Emmanuele Bassi
2008-05-07 15:03:59 +00:00
parent 0782e7d635
commit fabed98362
4 changed files with 63 additions and 8 deletions

View File

@ -143,6 +143,12 @@ clutter_backend_sdl_dispose (GObject *gobject)
backend_sdl->stage = NULL;
}
if (backend_sdl->timer)
{
g_timer_destroy (backend_sdl->timer);
backend_sdl->timer = NULL;
}
G_OBJECT_CLASS (clutter_backend_sdl_parent_class)->dispose (gobject);
}
@ -203,6 +209,8 @@ clutter_backend_sdl_init (ClutterBackendSDL *backend_sdl)
clutter_backend_set_resolution (backend, 96.0);
clutter_backend_set_double_click_time (backend, 250);
clutter_backend_set_double_click_distance (backend, 5);
backend_sdl->timer = g_timer_new ();
}
GType