]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Fix GTK3 size calculations in unifontsel_new.
authorSimon Tatham <anakin@pobox.com>
Sat, 22 Aug 2015 10:46:05 +0000 (11:46 +0100)
committerSimon Tatham <anakin@pobox.com>
Sat, 22 Aug 2015 10:55:30 +0000 (11:55 +0100)
commit03e21b7cad1dfa856f841dfe5aba39bb3ff89f7e
treeecfec3f87737e4e8e0cde14c35533a9791a30189
parent37ec0b463fd65f80c5cb7ca50b6b318b5d66bc24
Fix GTK3 size calculations in unifontsel_new.

It turns out that in GTK3, if you instantiate a GtkLabel and
immediately try to find out its preferred size, you get back zero for
both dimensions. Presumably none of that gets figured out properly
until the widget is displayed, or some such.

However, you can retrieve the PangoLayout from the label immediately
and ask Pango for the dimensions of that. That seems like a bit of a
bodge, but it works! The GTK3 unifont selector now comes out with all
the interface elements in sensible sizes - in particular, the preview
drawing area now has non-zero height.
unix/gtkfont.c