From 68b47e3ed479242a94f7a8d302a2900f7e28c840 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 7 Dec 2009 23:02:48 +0000 Subject: [PATCH] tests: Fix test-events output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • The enter/leave event line should take into account the case where the related field is set to NULL (meaning entering from off-stage and leaving the stage). • The ButtonRelease line shows the click count but uses the button; the button *and* the click count should be displayed for both ButtonPress and ButtonRelease, to verify they match. --- tests/interactive/test-events.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/interactive/test-events.c b/tests/interactive/test-events.c index 35400381f..3655fcc58 100644 --- a/tests/interactive/test-events.c +++ b/tests/interactive/test-events.c @@ -193,22 +193,28 @@ input_cb (ClutterActor *actor, case CLUTTER_ENTER: g_print ("[%s] ENTER (from:%s)", clutter_actor_get_name (source_actor), - clutter_actor_get_name (clutter_event_get_related (event))); + clutter_event_get_related (event) != NULL + ? clutter_actor_get_name (clutter_event_get_related (event)) + : ""); break; case CLUTTER_LEAVE: g_print ("[%s] LEAVE (to:%s)", clutter_actor_get_name (source_actor), - clutter_actor_get_name (clutter_event_get_related (event))); + clutter_event_get_related (event) != NULL + ? clutter_actor_get_name (clutter_event_get_related (event)) + : ""); break; case CLUTTER_BUTTON_PRESS: - g_print ("[%s] BUTTON PRESS (click count:%i)", + g_print ("[%s] BUTTON PRESS (button:%i, click count:%i)", clutter_actor_get_name (source_actor), + clutter_event_get_button (event), clutter_event_get_click_count (event)); break; case CLUTTER_BUTTON_RELEASE: - g_print ("[%s] BUTTON RELEASE (click count:%i)", + g_print ("[%s] BUTTON RELEASE (button:%i, click count:%i)", clutter_actor_get_name (source_actor), - clutter_event_get_button (event)); + clutter_event_get_button (event), + clutter_event_get_click_count (event)); if (source_actor == CLUTTER_ACTOR (stage)) clutter_stage_set_key_focus (stage, NULL);