#include <gtk/gtk.h>

static gboolean
cb (GtkWidget *canvas, GdkEventMotion *mevent, gpointer data)
{
  GdkTimeCoord **history_events;
  gint           n_history_events;

  gdk_device_get_history (mevent->device, mevent->window, 0, mevent->time,
                          &history_events, &n_history_events);
  return TRUE;
}

int
main (int argc, char **argv)
{
  GtkWidget *w, *d;

  gtk_init (&argc, &argv);

  w = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  g_signal_connect (w, "delete-event", G_CALLBACK (gtk_main_quit), NULL);

  d = gtk_drawing_area_new ();
  gtk_container_add (GTK_CONTAINER (w), d);

  gtk_widget_set_events (d, GDK_POINTER_MOTION_MASK);
  g_signal_connect (d, "motion-notify-event", G_CALLBACK (cb), NULL);

  gtk_widget_show_all (w);

  gtk_main ();

  return 0;
}
