- child = children->data;
- children = children->next;
-
- if (GTK_WIDGET_VISIBLE (child->widget))
- {
- child_allocation.x = child->x;
- child_allocation.y = child->y;
- child_allocation.width = child->widget->requisition.width;
- child_allocation.height = child->widget->requisition.height;
- gtk_widget_size_allocate (child->widget, &child_allocation);
- }
+ child = children->data;
+ children = children->next;
+
+ /* please look at the text in wxWindow::DoSetSize() on why the
+ test GTK_WIDGET_REALIZED() has to be here */
+ if (GTK_WIDGET_VISIBLE (child->widget))
+ {
+/* if (GTK_IS_NOTEBOOK(child->widget) && !GTK_WIDGET_REALIZED(child->widget))
+ {
+ gtk_widget_queue_resize( child->widget );
+ }
+ else */
+ {
+ child_allocation.x = child->x;
+ child_allocation.y = child->y;
+ child_allocation.width = MAX( child->width, 1 );
+ child_allocation.height = MAX( child->height, 1 );
+
+ /* work around for GTK bug when moving widgets outside
+ the X window -> do NOT move them entirely outside */
+ if (child_allocation.y + child_allocation.height < 0)
+ child_allocation.y = -child_allocation.height;
+ if (child_allocation.x + child_allocation.width < 0)
+ child_allocation.x = -child_allocation.width;
+
+ gtk_widget_size_allocate (child->widget, &child_allocation);
+ }
+ }