+ // Use a GtkEventBox for the title and borders. Using m_widget for this
+ // almost works, except that setting the resize cursor has no effect.
+ GtkWidget* eventbox = gtk_event_box_new();
+ gtk_widget_add_events(eventbox,
+ GDK_POINTER_MOTION_MASK |
+ GDK_POINTER_MOTION_HINT_MASK);
+ gtk_widget_show(eventbox);
+ // Use a GtkAlignment to position m_mainWidget inside the decorations
+ GtkWidget* alignment = gtk_alignment_new(0, 0, 1, 1);
+ gtk_alignment_set_padding(GTK_ALIGNMENT(alignment),
+ m_miniTitle + m_miniEdge, m_miniEdge, m_miniEdge, m_miniEdge);
+ gtk_widget_show(alignment);
+ // The GtkEventBox and GtkAlignment go between m_widget and m_mainWidget
+ gtk_widget_reparent(m_mainWidget, alignment);
+ gtk_container_add(GTK_CONTAINER(eventbox), alignment);
+ gtk_container_add(GTK_CONTAINER(m_widget), eventbox);
+
+ m_gdkDecor = 0;
+ m_gdkFunc = 0;
+ if (style & wxRESIZE_BORDER)
+ m_gdkFunc = GDK_FUNC_RESIZE;
+
+ // don't allow sizing smaller than decorations
+ GdkGeometry geom;
+ geom.min_width = 2 * m_miniEdge;
+ geom.min_height = 2 * m_miniEdge + m_miniTitle;
+ gtk_window_set_geometry_hints(GTK_WINDOW(m_widget), NULL, &geom, GDK_HINT_MIN_SIZE);
+