I now managed to get the correct number of lines here with the attached patch. Tested with GTK3, Lucid and without xtoolkit. Not tested with Motif. Please have a look. Thanks, martin