changeset 2589:df15eef16238

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.
author Colin Clark <colin.clark@cclark.uk>
date Fri, 08 Sep 2017 11:25:06 +0100
parents 669eeafa5d11
children 95606e2192d1
files src/bar.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/bar.c	Wed Sep 06 19:56:58 2017 +0100
+++ b/src/bar.c	Fri Sep 08 11:25:06 2017 +0100
@@ -739,7 +739,16 @@
 		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);