gtk_widget_get_preferred_size(comp.tree, NULL, &size);
gtk_window_get_size(GTK_WINDOW(vb.gui.window), NULL, &height);
height /= 3;
- if (size.height > height) {
- gtk_scrolled_window_set_min_content_height(GTK_SCROLLED_WINDOW(comp.win), height);
- }
+ gtk_scrolled_window_set_min_content_height(
+ GTK_SCROLLED_WINDOW(comp.win),
+ size.height > height ? height : size.height
+ );
#else
gtk_widget_size_request(comp.tree, &size);
gtk_window_get_size(GTK_WINDOW(vb.gui.window), NULL, &height);
gui->adjust_h = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(gui->scroll));
gui->adjust_v = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(gui->scroll));
+ /* GTK_POLICY_NEVER with gtk3 disallows window resizing and scrolling */
#ifndef HAS_GTK3
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(gui->scroll), GTK_POLICY_NEVER, GTK_POLICY_NEVER);
#endif