#include <gtk/gtk.h>

static gboolean
timeout_func (gpointer user_data)
{
  GMainLoop *loop = user_data;

  g_main_loop_quit (loop);

  return FALSE;
}

int
main (int argc, char *argv[])
{
  GMainLoop *loop;
  GtkWidget *window;
  GdkScreen *default_screen;
  gint       i;

  gtk_init (&argc, &argv);

  loop = g_main_loop_new (NULL, TRUE);

  g_timeout_add_seconds (3, timeout_func, loop);

  default_screen = gdk_screen_get_default ();
  for (i = 0; i < gdk_screen_get_n_monitors (default_screen); i++)
    {
      window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
      gtk_window_fullscreen_on_monitor (GTK_WINDOW (window), default_screen, i);
      gtk_widget_show_all (window);
    }

  g_main_loop_run (loop);

  return 0;
}
