output window: added allocation setting for drawing areas. fixes bug #45229.
authorFriedrich Beckmann <friedrich.beckmann@gmx.de>
Wed, 10 Jun 2015 18:27:55 +0000 (20:27 +0200)
committerFriedrich Beckmann <friedrich.beckmann@gmx.de>
Wed, 10 Jun 2015 18:27:55 +0000 (20:27 +0200)
I added allocation setting to the drawing areas in the output window. The
problem occured in osx gtk3 branch and is described in bug #45229. The
content of the output window was not rendered correctly in the initial
window but only after a resize. Setting the size request for the drawing
areas is not enough because the current allocation is not immediatly changed.
The clipping is based on the current allocation, while the drawing is based
on the results from the rerender function. This problem is related to
the problem described in bug #43362.

src/ui/gui/psppire-output-view.c

index a7de7848471e64073798be7872e91bec8d10bf9f..fef0185b0307d737b61ebd6ec9c37d82751d8020 100644 (file)
@@ -224,6 +224,7 @@ rerender (struct psppire_output_view *view)
   for (item = view->items; item < &view->items[view->n_items]; item++)
     {
       struct xr_rendering *r;
+      GtkAllocation alloc;
       int tw, th;
 
       if (view->y > 0)
@@ -251,6 +252,12 @@ rerender (struct psppire_output_view *view)
           gtk_layout_move (view->output, item->drawing_area, 0, view->y);
         }
 
+      alloc.x = 0;
+      alloc.y = view->y;
+      alloc.width = tw;
+      alloc.height = th;
+      gtk_widget_size_allocate(item->drawing_area,&alloc);
+
       if (view->max_width < tw)
         view->max_width = tw;
       view->y += th;