Date:  Mon Nov 17 21:59:38 PST 1997
Patch: gtk-dairiki-971117-2.patch

Here is yet another patch for gtkaspectframe.c.

Minor tweak.

This modifies the sub-widget size computation algorithm so that
it rounds computed dimensions to the nearest integer, rather than
truncating.

This may seem like a picky detail, but it is important in the case
that you want to auto-shrink-wrap your top level window around the
aspect-ratio-controlled frame.  Without the patch, a nearly-infinite
loop sometimes occurs:

  1. Top-level window is resized (or mapped).
  2. Aspect_frame computes some allocation (x,y) for it's subwidget.
  3. We set_usize(x,y) on our subwidget -- this triggers a
     resize of the top-level window.
  4. On the second-lap of resizing, the aspect_frame get's allocated
     exactly what it needs to fit the (x by y) sub-widget --- so far
     so good.
     But because of the truncation, it computes the size for the
     sub-widget to by (x, y-1) (say...).
  5. So we set_usize(x,y-1) on our subwidget, triggerint a third lap
     of resizes --- the next time our subwidget often gets allocated
     a size of (x-1,y-1).  This leads more laps: (x-1,y-2), (x-2,y-2),
     This can go on for a while while you watch your flashing window
     gradually shrink one pixel at a time.

With the rounding patch, this loop is guaranteed to terminate
at the third round of resizing --- usually it terminates on the second
round.

[ The patches are on gtk+-971109 + gtk-dairiki-971117-0.patch.
 I.e. you probably should apply gtk-dairiki-971117-0 before this one. ]

Geoffrey T. Dairiki <[email protected]>