2007-09-17 Emmanuele Bassi <ebassi@openedhand.com>

Merge from stable

	* clutter/eglnative/clutter-event-egl.c:
	Flag every device click after the first as motion events
	instead of button presses. (#505, Shreyas Srinivasan)
This commit is contained in:
Emmanuele Bassi 2007-09-17 11:34:03 +00:00
parent f5483054fc
commit c7ff2b7651
2 changed files with 24 additions and 4 deletions

View File

@ -1,3 +1,11 @@
2007-09-17 Emmanuele Bassi <ebassi@openedhand.com>
Merge from stable
* clutter/eglnative/clutter-event-egl.c:
Flag every device click after the first as motion events
instead of button presses. (#505, Shreyas Srinivasan)
2007-09-10 Matthew Allum <mallum@openedhand.com>
Port from stable branch.

View File

@ -191,11 +191,13 @@ clutter_event_dispatch (GSource *source,
struct ts_sample tsevent;
#endif
ClutterMainContext *clutter_context;
static gint last_x, last_y;
static gint last_x = 0, last_y = 0;
static gboolean clicked = FALSE;
clutter_threads_enter ();
clutter_context = clutter_context_get_default ();
#ifdef HAVE_TSLIB
/* FIXME while would be better here but need to deal with lockups */
if ((!clutter_events_pending()) &&
@ -218,10 +220,20 @@ clutter_event_dispatch (GSource *source,
event->button.modifier_state = 0;
event->button.button = 1;
if (tsevent.pressure)
if (tsevent.pressure && !clicked)
{
event->button.type = event->type = CLUTTER_BUTTON_PRESS;
clicked = TRUE;
}
else if (tsevent.pressure && clicked)
{
event->motion.type = event->type = CLUTTER_MOTION;
}
else
{
event->button.type = event->type = CLUTTER_BUTTON_RELEASE;
clicked = FALSE;
}
_clutter_event_button_generate (backend, event);