+GtkWidget *
+createwindow(Client *c)
+{
+ GtkWidget *w;
+
+ if (embed) {
+ w = gtk_plug_new(embed);
+ } else {
+ w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+
+ /* TA: 20091214: Despite what the GNOME docs say, the ICCCM
+ * is always correct, so we should still call this function.
+ * But when doing so, we *must* differentiate between a
+ * WM_CLASS and a resource on the window. By convention, the
+ * window class (WM_CLASS) is capped, while the resource is in
+ * lowercase. Both these values come as a pair.
+ */
+ gtk_window_set_wmclass(GTK_WINDOW(w), "surf", "Surf");
+
+ /* TA: 20091214: And set the role here as well -- so that
+ * sessions can pick this up.
+ */
+ gtk_window_set_role(GTK_WINDOW(w), "Surf");
+
+ gtk_window_set_default_size(GTK_WINDOW(w), 800, 600);
+ }
+
+ g_signal_connect(G_OBJECT(w), "destroy",
+ G_CALLBACK(destroywin), c);
+ g_signal_connect(G_OBJECT(w), "leave_notify_event",
+ G_CALLBACK(titlechangeleave), c);
+
+ return w;
+}
+