[Xfce4-commits] <terminal:master> Work around deprecated VTE function in 0.24.
Nick Schermer
noreply at xfce.org
Tue Apr 27 19:54:02 CEST 2010
Updating branch refs/heads/master
to fdbcc7c9f30210a176689bf1f5454f0354225bdb (commit)
from 9ed0e8a940f624dfb64a1a7e9b321db564fe7c64 (commit)
commit fdbcc7c9f30210a176689bf1f5454f0354225bdb
Author: Nick Schermer <nick at xfce.org>
Date: Tue Apr 27 19:52:50 2010 +0200
Work around deprecated VTE function in 0.24.
terminal/terminal-screen.c | 34 +++++++++++++++++++++++++++++++---
1 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/terminal/terminal-screen.c b/terminal/terminal-screen.c
index 1aaced5..208781a 100644
--- a/terminal/terminal-screen.c
+++ b/terminal/terminal-screen.c
@@ -1053,6 +1053,9 @@ terminal_screen_vte_resize_window (VteTerminal *terminal,
gint ypad;
gint grid_width;
gint grid_height;
+#if VTE_CHECK_VERSION (0, 24, 0)
+ GtkBorder *border = NULL;
+#endif
terminal_return_if_fail (VTE_IS_TERMINAL (terminal));
terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
@@ -1066,7 +1069,13 @@ terminal_screen_vte_resize_window (VteTerminal *terminal,
/* we have to calculate the grid size, because the signal
* returns a size in pixels */
+#if VTE_CHECK_VERSION (0, 24, 0)
+ gtk_widget_style_get (GTK_WIDGET (terminal), "inner-border", &border, NULL);
+ xpad = border->left + border->right;
+ ypad = border->top + border->bottom;
+#else
vte_terminal_get_padding (terminal, &xpad, &ypad);
+#endif
grid_width = (width - xpad) / terminal->char_width;
grid_height = (height - ypad) / terminal->char_height;
@@ -1407,16 +1416,25 @@ void
terminal_screen_set_window_geometry_hints (TerminalScreen *screen,
GtkWindow *window)
{
- GdkGeometry hints;
- gint xpad;
- gint ypad;
+ GdkGeometry hints;
+ gint xpad;
+ gint ypad;
+#if VTE_CHECK_VERSION (0, 24, 0)
+ GtkBorder *border = NULL;
+#endif
terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
terminal_return_if_fail (VTE_IS_TERMINAL (screen->terminal));
terminal_return_if_fail (GTK_WIDGET_REALIZED (screen));
terminal_return_if_fail (GTK_WIDGET_REALIZED (window));
+#if VTE_CHECK_VERSION (0, 24, 0)
+ gtk_widget_style_get (GTK_WIDGET (screen->terminal), "inner-border", &border, NULL);
+ xpad = border->left + border->right;
+ ypad = border->top + border->bottom;
+#else
vte_terminal_get_padding (VTE_TERMINAL (screen->terminal), &xpad, &ypad);
+#endif
hints.base_width = xpad;
hints.base_height = ypad;
@@ -1455,6 +1473,9 @@ terminal_screen_force_resize_window (TerminalScreen *screen,
gint rows;
gint xpad;
gint ypad;
+#if VTE_CHECK_VERSION (0, 24, 0)
+ GtkBorder *border = NULL;
+#endif
terminal_return_if_fail (TERMINAL_IS_SCREEN (screen));
terminal_return_if_fail (VTE_IS_TERMINAL (screen->terminal));
@@ -1478,7 +1499,14 @@ terminal_screen_force_resize_window (TerminalScreen *screen,
else
rows = force_rows;
+#if VTE_CHECK_VERSION (0, 24, 0)
+ gtk_widget_style_get (GTK_WIDGET (screen->terminal), "inner-border", &border, NULL);
+ xpad = border->left + border->right;
+ ypad = border->top + border->bottom;
+#else
vte_terminal_get_padding (VTE_TERMINAL (screen->terminal), &xpad, &ypad);
+#endif
+
width += xpad + VTE_TERMINAL (screen->terminal)->char_width * columns;
height += ypad + VTE_TERMINAL (screen->terminal)->char_height * rows;
More information about the Xfce4-commits
mailing list