#include <gtk/gtk.h>

void fs(GtkWidget *widget, gpointer data)
{
	gtk_widget_hide(GTK_WIDGET(data));
	gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(widget)));
}

void fs_nohide(GtkWidget *widget, gpointer data)
{
	gtk_window_fullscreen(GTK_WINDOW(gtk_widget_get_toplevel(widget)));
}

int main(int argc, char *argv[])
{
	GtkWidget *window, *vbox, *hbox, *button, *label;

	gtk_init(&argc, &argv);

	window=gtk_window_new(GTK_WINDOW_TOPLEVEL);

	vbox=gtk_vbox_new(FALSE, 0);
	gtk_container_add(GTK_CONTAINER(window), vbox);

	label=gtk_label_new("Hi, I'm a label");
	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);

	button=gtk_button_new_with_label("Uncorrect fullscreen which hides label");
	gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(fs), label);

	button=gtk_button_new_with_label("Correct fullscreen which does not hide label");
	gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(fs_nohide), label);

	button=gtk_button_new_from_stock(GTK_STOCK_QUIT);
	gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
	g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(gtk_main_quit), NULL);

	gtk_widget_show_all(window);

	gtk_main();
}
