test-scroll-view: Swallow button events on the scroll-view

Due to behaviour changes in the kinetic scroll-view, dragging inside the
view was moving the window. Fix this by swallowing button events on the
scroll-view, so that they don't bubble down to the stage.
This commit is contained in:
Chris Lord 2011-05-10 21:25:48 +01:00
parent 3aa5ce5490
commit 61d7ea438e
1 changed files with 12 additions and 0 deletions

View File

@ -41,6 +41,12 @@ notify_elastic_cb (MxToggle *toggle,
mx_adjustment_set_elastic (vadjust, on);
}
static gboolean
true_cb ()
{
return TRUE;
}
void
scroll_view_main (ClutterContainer *stage)
{
@ -49,6 +55,12 @@ scroll_view_main (ClutterContainer *stage)
ClutterActor *label, *elastic, *overshoot, *scroll, *kinetic, *view, *texture;
scroll = mx_scroll_view_new ();
/* Make sure something underneath the kinetic scroll view swallows events
* so that we don't end up moving the window.
*/
g_signal_connect (scroll, "button-press-event", G_CALLBACK (true_cb), NULL);
kinetic = mx_kinetic_scroll_view_new ();
clutter_container_add_actor (stage, scroll);