GtkFileChooser default window height waay too big
Submitted by and..@..oo.com
Link to original bug (#724562)
Description
When gtk+ based program is starting for the first time, file chooser window height is calculated by the functions find_good_size_from_style() and gtk_file_chooser_default_get_default_size() in gtkfilechooserwidget.c ( or in gtkfilechooserdefault.c in 3.10.x versions and earlier).
If one takes default resolution value 96, font size of 12 (so it does not hurts eyes), find_good_size_from_style() would return height of 720 pixels.
Further on, in gtk_file_chooser_default_get_default_size(), if there is extra widget set, the default height might increase even more. Typically any extra button or checkbox would add 100px extra, which would result, in ~820 px default height.
I think it is not completely correct to add extra widget height to default height without check what the actual screen height is. As result, on mainstream computer, with screen resolution of 1366x768 px, file chooser will not fit on the screen and might cause strange rendering and other issues like described in the bug #668022 ( https://bugzilla.gnome.org/show_bug.cgi?id=668022 ).
I should note, that once resized, filechooser will remember new setting, and this problem wont be visible. On MacOSX one has to remove related plist file from ~/Library/Preferences/, there should be something similar also on Linux.
There are number of ways how to fix it. It would be reasonable to discard addition of extra widget height (or make sure that it is less than screen height). When calculating font size in find_good_size_from_style(), there is division by 72, which looks kind of arbitrary. Whay not 96 - default resolution?
Version: 3.11.x