// gcc -Wall -o test test.c `pkg-config --libs --cflags gtk+-3.0`

#include <gtk/gtk.h>

#define BROKEN 1

#if BROKEN
#define MAXIMISE_TIMEOUT 2001
#else
#define MAXIMISE_TIMEOUT 2100
#endif

static gboolean
resizable_timeout (GtkWidget *window)
{
	g_message ("Setting resizable");
	gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
	return FALSE;
}

static gboolean
maximise_timeout (GtkWidget *window)
{
	g_message ("Maximising");
	gtk_window_maximize (GTK_WINDOW (window));
	return FALSE;
}

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

	gtk_init (&argc, &argv);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
	gtk_container_set_border_width (GTK_CONTAINER (window), 50);
	gtk_container_add (GTK_CONTAINER (window), gtk_label_new ("Test"));
	gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
	gtk_widget_show_all (window);

	g_timeout_add (2000,
		       (GSourceFunc) resizable_timeout,
		       window);

	g_timeout_add (MAXIMISE_TIMEOUT,
		       (GSourceFunc) maximise_timeout,
		       window);

	gtk_main ();

	return 0;
}
