/*
 * Demonstrate the difference in stacking between X11 and Wayland.
 *
 * Build with:
 * $ gcc -o testdialog testdialog.c `pkg-config --libs --cflags gtk+-3.0`
 *
 */

#include <gtk/gtk.h>

int
main (int argc, char *argv[])
{
  GtkWidget *window1;
  GtkWidget *window2;
  GtkWidget *window3;
  GtkWidget *label;


  gtk_init (NULL, NULL);

  window1 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window1), 600, 400);
  gtk_window_set_title (GTK_WINDOW (window1), "A toplevel window");
  g_signal_connect (window1, "destroy", gtk_main_quit, NULL);

  window2 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window2), 600, 400);
  gtk_window_set_title (GTK_WINDOW (window2), "Another toplevel window");
  g_signal_connect (window2, "destroy", gtk_main_quit, NULL);

  window3 = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  gtk_window_set_default_size (GTK_WINDOW (window3), 300, 200);
  gtk_window_set_type_hint (GTK_WINDOW (window3), GDK_WINDOW_TYPE_HINT_DIALOG);
  gtk_window_set_title (GTK_WINDOW (window3), "And a dialog type window");
  g_signal_connect (window3, "destroy", gtk_main_quit, NULL);

  label = gtk_label_new ("Now try to restack these windows on X11 and on Wayland...");
  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
  gtk_container_add (GTK_CONTAINER (window3), label);

  gtk_widget_show (label);
  gtk_widget_show (window1);
  gtk_widget_show (window2);
  gtk_widget_show (window3);

  gtk_main ();
}
