Comment 33 for bug 1451924

Revision history for this message
In , Chpe (chpe) wrote :

Review of attachment 327779:

Before I review this more in depth, I have a question:

> GtkScrolledWindow doesn't use the natural height and width
> of its child widget if the scrollbar policy is not NEVER. Instead it
> uses the minimum size. We don't want that because the minimum size of
> a VteTerminal is 1x1.

Wouldn't an adding support to GtkScrolledWindow for GTK_SIZE_REQUEST_CONSTANT_SIZE widget looks essentially like this new code in terminal-scrolled-window? If so, I'd really prefer this part to be done inside gtk+.

> we override GtkScrolledWindow's
> get_preferred_height and get_preferred_width virtual methods to make
> it use the natural size.

This will still run GtkScrolledWindow's size-allocate function which doesn't handle CONSTANT_SIZE children...

::: src/terminal-screen-container.c
@@ +21,3 @@
 #include "terminal-debug.h"

+#if GTK_CHECK_VERSION (3, 19, 5)

Let's do

#if gtk 3.19.5
#define USE_SCROLLED_WINDOW
#endif

and then use that new define everywhere below. Makes it easier by just having to change one place when one wants to try both code paths.

@@ +134,3 @@
+
+ gtk_container_add (GTK_CONTAINER (container), priv->scrolled_window);
+ gtk_widget_show_all (priv->scrolled_window);

I prefer individual gtk_widget_show() for each widget instead of show-all.