From: Colin Clark Date: Fri, 8 Sep 2017 10:25:06 +0000 (+0100) Subject: Bug fix: Info sidebar width in GTK3 X-Git-Tag: v1.4~100 X-Git-Url: http://geeqie.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ceb6bcd100d9dca49481dfc0797551fa2f07d70;p=geeqie.git Bug fix: Info sidebar width in GTK3 In bar_size_allocate() the width obained is the allocated width. In GTK2 this is the actual width. In GTK3 it is the *minimum* width. This results in the info sidebar being able to increase, but not decrease. There does not seem to be a way in GTK3 to get the actual width of a widget. For GTK3 the only way is to disable it. The width of the sidebar is therefore not preserved across restarts. --- diff --git a/src/bar.c b/src/bar.c index d607202d8..0eb8fdf2d 100644 --- a/src/bar.c +++ b/src/bar.c @@ -739,7 +739,16 @@ GtkWidget *bar_update_from_config(GtkWidget *bar, const gchar **attribute_names, log_printf("unknown attribute %s = %s\n", option, value); } +#if !GTK_CHECK_VERSION(3,0,0) +/* FIXME: In bar_size_allocate() the width obained is the allocated width. In GTK2 this + * is the actual width. In GTK3 it is the *minimum* width. + * This results in the info sidebar being able to increase, but not + * decrease. There does not seem to be a way in GTK3 to get the actual width of + * a widget. For GTK3 the only way is to disable it. The width of the sidebar + * is therefore not preserved across restarts. + */ gtk_widget_set_size_request(bar, width, -1); +#endif if (enabled) { gtk_widget_show(bar);