Fix resizing with GTK3
Taken from https://git.gnome.org/browse/gnome-terminal/commit/?h=gnome-3-0&id=8e6454b0efc01cf212f338c76d5d0557575f9513 Close #36 (https://github.com/mate-desktop/mate-terminal/issues/36)master-1.22
parent
8c3fa11972
commit
a3d9254d73
|
@ -45,7 +45,7 @@ DCONF_OLD_REQUIRED=0.10.0
|
|||
GLIB_REQUIRED=2.25.0
|
||||
GIO_REQUIRED=2.25.12
|
||||
GTK_REQUIRED=2.14.0
|
||||
VTE_REQUIRED=0.25.91
|
||||
VTE_REQUIRED=0.27.1
|
||||
|
||||
AC_MSG_CHECKING([which gtk+ version to compile against])
|
||||
AC_ARG_WITH([gtk],
|
||||
|
@ -63,7 +63,7 @@ case "$with_gtk" in
|
|||
VTE_PC_VERSION=
|
||||
;;
|
||||
3.0) GTK_API_VERSION=3.0
|
||||
GTK_REQUIRED=2.90.6
|
||||
GTK_REQUIRED=2.91.1
|
||||
VTE_PC_VERSION=-2.90
|
||||
;;
|
||||
esac
|
||||
|
|
|
@ -2702,17 +2702,19 @@ terminal_window_set_size_force_grid (TerminalWindow *window,
|
|||
int force_grid_width,
|
||||
int force_grid_height)
|
||||
{
|
||||
/* Owen's hack from mate-terminal */
|
||||
GtkWidget *widget;
|
||||
GtkWidget *app;
|
||||
int grid_width;
|
||||
int grid_height;
|
||||
#if !GTK_CHECK_VERSION (3, 0, 0)
|
||||
/* Owen's hack from gnome-terminal */
|
||||
GtkRequisition toplevel_request;
|
||||
GtkRequisition widget_request;
|
||||
int w, h;
|
||||
int char_width;
|
||||
int char_height;
|
||||
int grid_width;
|
||||
int grid_height;
|
||||
GtkBorder *inner_border = NULL;
|
||||
#endif
|
||||
|
||||
/* be sure our geometry is up-to-date */
|
||||
terminal_window_update_geometry (window);
|
||||
|
@ -2722,6 +2724,18 @@ terminal_window_set_size_force_grid (TerminalWindow *window,
|
|||
app = gtk_widget_get_toplevel (widget);
|
||||
g_assert (app != NULL);
|
||||
|
||||
#if GTK_CHECK_VERSION (3, 0, 0)
|
||||
terminal_screen_get_size (screen, &grid_width, &grid_height);
|
||||
|
||||
if (force_grid_width >= 0)
|
||||
grid_width = force_grid_width;
|
||||
if (force_grid_height >= 0)
|
||||
grid_height = force_grid_height;
|
||||
if (even_if_mapped && gtk_widget_get_mapped (app))
|
||||
gtk_window_resize_to_geometry (GTK_WINDOW (app), grid_width, grid_height);
|
||||
else
|
||||
gtk_window_set_default_geometry (GTK_WINDOW (app), grid_width, grid_height);
|
||||
#else
|
||||
gtk_widget_size_request (app, &toplevel_request);
|
||||
gtk_widget_size_request (widget, &widget_request);
|
||||
|
||||
|
@ -2761,6 +2775,7 @@ terminal_window_set_size_force_grid (TerminalWindow *window,
|
|||
{
|
||||
gtk_window_set_default_size (GTK_WINDOW (app), w, h);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Reference in New Issue