mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 18:11:05 -05:00
tests: handle smooth scroll events in test-events
Print the precise scroll delta for smooth scroll events and correctly print the direction for left/right scrolls. https://bugzilla.gnome.org/show_bug.cgi?id=683870
This commit is contained in:
parent
8a69210363
commit
47347d5f5c
@ -254,11 +254,24 @@ input_cb (ClutterActor *actor,
|
|||||||
clutter_actor_get_name (source_actor));
|
clutter_actor_get_name (source_actor));
|
||||||
break;
|
break;
|
||||||
case CLUTTER_SCROLL:
|
case CLUTTER_SCROLL:
|
||||||
|
{
|
||||||
|
ClutterScrollDirection dir = clutter_event_get_scroll_direction(event);
|
||||||
|
|
||||||
|
if (dir == CLUTTER_SCROLL_SMOOTH)
|
||||||
|
{
|
||||||
|
gdouble dx, dy;
|
||||||
|
clutter_event_get_scroll_delta(event, &dx, &dy);
|
||||||
|
g_print ("[%s] BUTTON SCROLL (direction:smooth %.02f,%.02f)",
|
||||||
|
clutter_actor_get_name (source_actor), dx, dy);
|
||||||
|
}
|
||||||
|
else
|
||||||
g_print ("[%s] BUTTON SCROLL (direction:%s)",
|
g_print ("[%s] BUTTON SCROLL (direction:%s)",
|
||||||
clutter_actor_get_name (source_actor),
|
clutter_actor_get_name (source_actor),
|
||||||
clutter_event_get_scroll_direction (event) == CLUTTER_SCROLL_UP
|
dir == CLUTTER_SCROLL_UP ? "up" :
|
||||||
? "up"
|
dir == CLUTTER_SCROLL_DOWN ? "down" :
|
||||||
: "down");
|
dir == CLUTTER_SCROLL_LEFT ? "left" :
|
||||||
|
dir == CLUTTER_SCROLL_RIGHT ? "right" : "?");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case CLUTTER_STAGE_STATE:
|
case CLUTTER_STAGE_STATE:
|
||||||
g_print ("[%s] STAGE STATE", clutter_actor_get_name (source_actor));
|
g_print ("[%s] STAGE STATE", clutter_actor_get_name (source_actor));
|
||||||
|
Loading…
Reference in New Issue
Block a user