Created attachment 7037
In fact, minimal width and minimal height could be set to something more reasonable...
Thanks for the patch. It does indeed correct horizontal resizing, but broke the expected functionality when used in a vertically scrolled window. I applied another patch on top of that (restoring previous height calculations) to resolve this issue.
Maybe this change causes Bug 14737.