/* gdk_window_get_state() test app
 *
 * Compile:
 * gcc `pkg-config --cflags gtk+-3.0` -o state state.c `pkg-config --libs gtk+-3.0` 
 */

#include <gtk/gtk.h>

void mycallback(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data) {
	int width, height;
	GdkWindowState state;
	
	gtk_window_get_size(widget, &width, &height);

	GdkWindow *gdk_window = gtk_widget_get_window(widget);
	state = gdk_window_get_state(gdk_window);

	printf("state = 0x%x, width = %d, height = %d\n", state, width, height);
}

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);

	g_signal_connect (window, "configure-event", G_CALLBACK (mycallback), NULL);

	gtk_widget_show (window);

	gtk_main ();

	return 0;
}
