Merge branch 'vte291'

master-1.22
Wolfgang Ulbrich 2015-11-28 20:11:15 +01:00
commit 1e12282051
8 changed files with 206 additions and 10 deletions

View File

@ -68,7 +68,7 @@ case "$with_gtk" in
3.0) GTK_API_VERSION=3.0 3.0) GTK_API_VERSION=3.0
GTK_REQUIRED=3.0.0 GTK_REQUIRED=3.0.0
GDK_TARGETS="$($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION)" GDK_TARGETS="$($PKG_CONFIG --variable targets gdk-$GTK_API_VERSION)"
VTE_PC_VERSION=-2.90 VTE_PC_VERSION=-2.91
;; ;;
esac esac

View File

@ -141,6 +141,27 @@ profile_notify_sensitivity_cb (TerminalProfile *profile,
!terminal_profile_property_locked (profile, TERMINAL_PROFILE_CUSTOM_COMMAND)); !terminal_profile_property_locked (profile, TERMINAL_PROFILE_CUSTOM_COMMAND));
} }
#if VTE_CHECK_VERSION (0, 38, 0)
gtk_widget_hide (profile_editor_get_widget (editor, "background-image"));
gtk_widget_hide (profile_editor_get_widget (editor, "darken-background-transparent-or-image-scale-label"));
gtk_widget_show (profile_editor_get_widget (editor, "darken-background-transparent-scale-label"));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE))
{
gboolean bg_type_locked = terminal_profile_property_locked (profile, TERMINAL_PROFILE_BACKGROUND_TYPE);
SET_SENSITIVE ("solid-radiobutton", !bg_type_locked);
SET_SENSITIVE ("transparent-radiobutton", !bg_type_locked);
bg_type = terminal_profile_get_property_enum (profile, TERMINAL_PROFILE_BACKGROUND_TYPE);
if (bg_type == TERMINAL_BACKGROUND_TRANSPARENT)
{
SET_SENSITIVE ("darken-background-vbox", !terminal_profile_property_locked (profile, TERMINAL_PROFILE_BACKGROUND_DARKNESS));
}
else
{
SET_SENSITIVE ("darken-background-vbox", FALSE);
}
}
#else
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE)) if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE))
{ {
gboolean bg_type_locked = terminal_profile_property_locked (profile, TERMINAL_PROFILE_BACKGROUND_TYPE); gboolean bg_type_locked = terminal_profile_property_locked (profile, TERMINAL_PROFILE_BACKGROUND_TYPE);
@ -168,6 +189,7 @@ profile_notify_sensitivity_cb (TerminalProfile *profile,
SET_SENSITIVE ("darken-background-vbox", FALSE); SET_SENSITIVE ("darken-background-vbox", FALSE);
} }
} }
#endif
if (!prop_name || if (!prop_name ||
prop_name == I_(TERMINAL_PROFILE_USE_SYSTEM_FONT) || prop_name == I_(TERMINAL_PROFILE_USE_SYSTEM_FONT) ||

View File

@ -2202,7 +2202,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkVBox" id="vbox87"> <object class="GtkVBox" id="background-image">
<property name="visible">True</property> <property name="visible">True</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
@ -2354,7 +2354,7 @@
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkLabel" id="darken-background-scale-label"> <object class="GtkLabel" id="darken-background-transparent-or-image-scale-label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="label" translatable="yes">S_hade transparent or image background:</property> <property name="label" translatable="yes">S_hade transparent or image background:</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
@ -2378,6 +2378,31 @@
<property name="fill">False</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child>
<object class="GtkLabel" id="darken-background-transparent-scale-label">
<property name="visible">False</property>
<property name="label" translatable="yes">S_hade transparent background:</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="mnemonic_widget">darken-background-scale</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</object>
<packing>
<property name="padding">1</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child> <child>
<object class="GtkHBox" id="hbox6"> <object class="GtkHBox" id="hbox6">
<property name="visible">True</property> <property name="visible">True</property>

View File

@ -1271,10 +1271,17 @@ terminal_profile_class_init (TerminalProfileClass *klass)
TERMINAL_PROFILE_PROPERTY_DOUBLE (BACKGROUND_DARKNESS, 0.0, 1.0, DEFAULT_BACKGROUND_DARKNESS, KEY_BACKGROUND_DARKNESS); TERMINAL_PROFILE_PROPERTY_DOUBLE (BACKGROUND_DARKNESS, 0.0, 1.0, DEFAULT_BACKGROUND_DARKNESS, KEY_BACKGROUND_DARKNESS);
TERMINAL_PROFILE_PROPERTY_ENUM (BACKGROUND_TYPE, TERMINAL_TYPE_BACKGROUND_TYPE, DEFAULT_BACKGROUND_TYPE, KEY_BACKGROUND_TYPE); TERMINAL_PROFILE_PROPERTY_ENUM (BACKGROUND_TYPE, TERMINAL_TYPE_BACKGROUND_TYPE, DEFAULT_BACKGROUND_TYPE, KEY_BACKGROUND_TYPE);
#if VTE_CHECK_VERSION (0, 38, 0)
TERMINAL_PROFILE_PROPERTY_ENUM (BACKSPACE_BINDING, VTE_TYPE_ERASE_BINDING, DEFAULT_BACKSPACE_BINDING, KEY_BACKSPACE_BINDING);
TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, VTE_TYPE_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE);
TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_SHAPE, VTE_TYPE_CURSOR_SHAPE, DEFAULT_CURSOR_SHAPE, KEY_CURSOR_SHAPE);
TERMINAL_PROFILE_PROPERTY_ENUM (DELETE_BINDING, VTE_TYPE_ERASE_BINDING, DEFAULT_DELETE_BINDING, KEY_DELETE_BINDING);
#else
TERMINAL_PROFILE_PROPERTY_ENUM (BACKSPACE_BINDING, VTE_TYPE_TERMINAL_ERASE_BINDING, DEFAULT_BACKSPACE_BINDING, KEY_BACKSPACE_BINDING); TERMINAL_PROFILE_PROPERTY_ENUM (BACKSPACE_BINDING, VTE_TYPE_TERMINAL_ERASE_BINDING, DEFAULT_BACKSPACE_BINDING, KEY_BACKSPACE_BINDING);
TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE); TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_BLINK_MODE, VTE_TYPE_TERMINAL_CURSOR_BLINK_MODE, DEFAULT_CURSOR_BLINK_MODE, KEY_CURSOR_BLINK_MODE);
TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_SHAPE, VTE_TYPE_TERMINAL_CURSOR_SHAPE, DEFAULT_CURSOR_SHAPE, KEY_CURSOR_SHAPE); TERMINAL_PROFILE_PROPERTY_ENUM (CURSOR_SHAPE, VTE_TYPE_TERMINAL_CURSOR_SHAPE, DEFAULT_CURSOR_SHAPE, KEY_CURSOR_SHAPE);
TERMINAL_PROFILE_PROPERTY_ENUM (DELETE_BINDING, VTE_TYPE_TERMINAL_ERASE_BINDING, DEFAULT_DELETE_BINDING, KEY_DELETE_BINDING); TERMINAL_PROFILE_PROPERTY_ENUM (DELETE_BINDING, VTE_TYPE_TERMINAL_ERASE_BINDING, DEFAULT_DELETE_BINDING, KEY_DELETE_BINDING);
#endif
TERMINAL_PROFILE_PROPERTY_ENUM (EXIT_ACTION, TERMINAL_TYPE_EXIT_ACTION, DEFAULT_EXIT_ACTION, KEY_EXIT_ACTION); TERMINAL_PROFILE_PROPERTY_ENUM (EXIT_ACTION, TERMINAL_TYPE_EXIT_ACTION, DEFAULT_EXIT_ACTION, KEY_EXIT_ACTION);
TERMINAL_PROFILE_PROPERTY_ENUM (SCROLLBAR_POSITION, TERMINAL_TYPE_SCROLLBAR_POSITION, DEFAULT_SCROLLBAR_POSITION, KEY_SCROLLBAR_POSITION); TERMINAL_PROFILE_PROPERTY_ENUM (SCROLLBAR_POSITION, TERMINAL_TYPE_SCROLLBAR_POSITION, DEFAULT_SCROLLBAR_POSITION, KEY_SCROLLBAR_POSITION);
TERMINAL_PROFILE_PROPERTY_ENUM (TITLE_MODE, TERMINAL_TYPE_TITLE_MODE, DEFAULT_TITLE_MODE, KEY_TITLE_MODE); TERMINAL_PROFILE_PROPERTY_ENUM (TITLE_MODE, TERMINAL_TYPE_TITLE_MODE, DEFAULT_TITLE_MODE, KEY_TITLE_MODE);

View File

@ -143,7 +143,11 @@ terminal_screen_container_constructor (GType type,
g_assert (priv->screen != NULL); g_assert (priv->screen != NULL);
#ifdef USE_SCROLLED_WINDOW #ifdef USE_SCROLLED_WINDOW
#if VTE_CHECK_VERSION (0, 38, 0)
priv->scrolled_window = gtk_scrolled_window_new (NULL, gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->screen)));
#else
priv->scrolled_window = gtk_scrolled_window_new (NULL, vte_terminal_get_adjustment (VTE_TERMINAL (priv->screen))); priv->scrolled_window = gtk_scrolled_window_new (NULL, vte_terminal_get_adjustment (VTE_TERMINAL (priv->screen)));
#endif
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->scrolled_window),
priv->hscrollbar_policy, priv->hscrollbar_policy,
@ -163,7 +167,11 @@ terminal_screen_container_constructor (GType type,
priv->hbox = gtk_hbox_new (FALSE, 0); priv->hbox = gtk_hbox_new (FALSE, 0);
#if VTE_CHECK_VERSION (0, 38, 0)
priv->vscrollbar = gtk_vscrollbar_new (gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (priv->screen)));
#else
priv->vscrollbar = gtk_vscrollbar_new (vte_terminal_get_adjustment (VTE_TERMINAL (priv->screen))); priv->vscrollbar = gtk_vscrollbar_new (vte_terminal_get_adjustment (VTE_TERMINAL (priv->screen)));
#endif
gtk_box_pack_start (GTK_BOX (priv->hbox), GTK_WIDGET (priv->screen), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (priv->hbox), GTK_WIDGET (priv->screen), TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (priv->hbox), priv->vscrollbar, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->vscrollbar, FALSE, FALSE, 0);

View File

@ -119,7 +119,11 @@ static gboolean terminal_screen_popup_menu (GtkWidget *widget);
static gboolean terminal_screen_button_press (GtkWidget *widget, static gboolean terminal_screen_button_press (GtkWidget *widget,
GdkEventButton *event); GdkEventButton *event);
static void terminal_screen_launch_child_on_idle (TerminalScreen *screen); static void terminal_screen_launch_child_on_idle (TerminalScreen *screen);
static void terminal_screen_child_exited (VteTerminal *terminal); #if VTE_CHECK_VERSION (0, 38, 0)
static void terminal_screen_child_exited (VteTerminal *terminal, int status);
#else
static void terminal_screen_child_exited (VteTerminal *terminal);
#endif
static void terminal_screen_window_title_changed (VteTerminal *vte_terminal, static void terminal_screen_window_title_changed (VteTerminal *vte_terminal,
TerminalScreen *screen); TerminalScreen *screen);
@ -134,8 +138,12 @@ static void terminal_screen_cook_title (TerminalScreen *screen);
static void terminal_screen_cook_icon_title (TerminalScreen *screen); static void terminal_screen_cook_icon_title (TerminalScreen *screen);
static char* terminal_screen_check_match (TerminalScreen *screen, static char* terminal_screen_check_match (TerminalScreen *screen,
#if VTE_CHECK_VERSION (0, 38, 0)
GdkEvent *event,
#else
int column, int column,
int row, int row,
#endif
int *flavor); int *flavor);
static guint signals[LAST_SIGNAL] = { 0 }; static guint signals[LAST_SIGNAL] = { 0 };
@ -284,6 +292,7 @@ terminal_screen_get_window (TerminalScreen *screen)
return TERMINAL_WINDOW (toplevel); return TERMINAL_WINDOW (toplevel);
} }
#if !VTE_CHECK_VERSION (0, 38, 0)
static gboolean static gboolean
window_uses_argb_visual (TerminalScreen *screen) window_uses_argb_visual (TerminalScreen *screen)
{ {
@ -295,21 +304,26 @@ window_uses_argb_visual (TerminalScreen *screen)
return terminal_window_uses_argb_visual (window); return terminal_window_uses_argb_visual (window);
} }
#endif
static void static void
terminal_screen_realize (GtkWidget *widget) terminal_screen_realize (GtkWidget *widget)
{ {
#if !VTE_CHECK_VERSION (0, 38, 0)
TerminalScreen *screen = TERMINAL_SCREEN (widget); TerminalScreen *screen = TERMINAL_SCREEN (widget);
TerminalScreenPrivate *priv = screen->priv; TerminalScreenPrivate *priv = screen->priv;
TerminalBackgroundType bg_type; TerminalBackgroundType bg_type;
#endif
GTK_WIDGET_CLASS (terminal_screen_parent_class)->realize (widget); GTK_WIDGET_CLASS (terminal_screen_parent_class)->realize (widget);
#if !VTE_CHECK_VERSION (0, 38, 0)
/* FIXME: Don't enable this if we have a compmgr. */ /* FIXME: Don't enable this if we have a compmgr. */
bg_type = terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_BACKGROUND_TYPE); bg_type = terminal_profile_get_property_enum (priv->profile, TERMINAL_PROFILE_BACKGROUND_TYPE);
vte_terminal_set_background_transparent (VTE_TERMINAL (screen), vte_terminal_set_background_transparent (VTE_TERMINAL (screen),
bg_type == TERMINAL_BACKGROUND_TRANSPARENT && bg_type == TERMINAL_BACKGROUND_TRANSPARENT &&
!window_uses_argb_visual (screen)); !window_uses_argb_visual (screen));
#endif
} }
static void static void
@ -917,7 +931,9 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
GObject *object = G_OBJECT (screen); GObject *object = G_OBJECT (screen);
VteTerminal *vte_terminal = VTE_TERMINAL (screen); VteTerminal *vte_terminal = VTE_TERMINAL (screen);
const char *prop_name; const char *prop_name;
#if !VTE_CHECK_VERSION (0, 38, 0)
TerminalBackgroundType bg_type; TerminalBackgroundType bg_type;
#endif
TerminalWindow *window; TerminalWindow *window;
if (pspec) if (pspec)
@ -961,6 +977,10 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
prop_name == I_(TERMINAL_PROFILE_USE_THEME_COLORS) || prop_name == I_(TERMINAL_PROFILE_USE_THEME_COLORS) ||
prop_name == I_(TERMINAL_PROFILE_FOREGROUND_COLOR) || prop_name == I_(TERMINAL_PROFILE_FOREGROUND_COLOR) ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_COLOR) || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_COLOR) ||
#if VTE_CHECK_VERSION (0, 38, 0)
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE) ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_DARKNESS) ||
#endif
prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG) || prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR_SAME_AS_FG) ||
prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR) || prop_name == I_(TERMINAL_PROFILE_BOLD_COLOR) ||
prop_name == I_(TERMINAL_PROFILE_PALETTE)) prop_name == I_(TERMINAL_PROFILE_PALETTE))
@ -970,8 +990,15 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
vte_terminal_set_audible_bell (vte_terminal, !terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_SILENT_BELL)); vte_terminal_set_audible_bell (vte_terminal, !terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_SILENT_BELL));
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_WORD_CHARS)) if (!prop_name || prop_name == I_(TERMINAL_PROFILE_WORD_CHARS))
#if VTE_CHECK_VERSION (0, 40, 0)
vte_terminal_set_word_char_exceptions (vte_terminal,
terminal_profile_get_property_string (profile, TERMINAL_PROFILE_WORD_CHARS));
#elif !VTE_CHECK_VERSION (0, 38, 0)
vte_terminal_set_word_chars (vte_terminal, vte_terminal_set_word_chars (vte_terminal,
terminal_profile_get_property_string (profile, TERMINAL_PROFILE_WORD_CHARS)); terminal_profile_get_property_string (profile, TERMINAL_PROFILE_WORD_CHARS));
#else
{}
#endif
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE)) if (!prop_name || prop_name == I_(TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE))
vte_terminal_set_scroll_on_keystroke (vte_terminal, vte_terminal_set_scroll_on_keystroke (vte_terminal,
terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE)); terminal_profile_get_property_boolean (profile, TERMINAL_PROFILE_SCROLL_ON_KEYSTROKE));
@ -1013,6 +1040,9 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
} }
#endif /* ENABLE_SKEY */ #endif /* ENABLE_SKEY */
/* Background image support was removed in vte 0.38.
* Transparency for 0.38+ is handled above next to TERMINAL_PROFILE_BACKGROUND_COLOR. */
#if !VTE_CHECK_VERSION (0, 38, 0)
if (!prop_name || if (!prop_name ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE) || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_TYPE) ||
prop_name == I_(TERMINAL_PROFILE_BACKGROUND_IMAGE) || prop_name == I_(TERMINAL_PROFILE_BACKGROUND_IMAGE) ||
@ -1053,6 +1083,7 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
bg_type == TERMINAL_BACKGROUND_TRANSPARENT && bg_type == TERMINAL_BACKGROUND_TRANSPARENT &&
!window_uses_argb_visual (screen)); !window_uses_argb_visual (screen));
} }
#endif
if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKSPACE_BINDING)) if (!prop_name || prop_name == I_(TERMINAL_PROFILE_BACKSPACE_BINDING))
vte_terminal_set_backspace_binding (vte_terminal, vte_terminal_set_backspace_binding (vte_terminal,
@ -1077,6 +1108,23 @@ terminal_screen_profile_notify_cb (TerminalProfile *profile,
g_object_thaw_notify (object); g_object_thaw_notify (object);
} }
/* TODO: Once Gtk2 support is dropped, mate-terminal should be converted to use GdkRGBA everywhere instead of GdkColor. */
#if VTE_CHECK_VERSION (0, 38, 0)
static GdkRGBA *
gdk_color_to_rgba (const GdkColor *color,
double alpha,
GdkRGBA *rgba)
{
if (color == NULL)
return NULL;
rgba->red = color->red / 65535.0;
rgba->green = color->green / 65535.0;
rgba->blue = color->blue / 65535.0;
rgba->alpha = alpha;
return rgba;
}
#endif
static void static void
update_color_scheme (TerminalScreen *screen) update_color_scheme (TerminalScreen *screen)
{ {
@ -1112,11 +1160,33 @@ update_color_scheme (TerminalScreen *screen)
n_colors = G_N_ELEMENTS (colors); n_colors = G_N_ELEMENTS (colors);
terminal_profile_get_palette (priv->profile, colors, &n_colors); terminal_profile_get_palette (priv->profile, colors, &n_colors);
#if VTE_CHECK_VERSION (0, 38, 0)
{
GdkRGBA colors_rgba[TERMINAL_PALETTE_SIZE];
GdkRGBA fg_rgba, bg_rgba, bold_rgba;
double alpha = 1.0;
int i;
for (i = 0; i < n_colors; i++)
gdk_color_to_rgba (&colors[i], 1.0, &colors_rgba[i]);
if (terminal_profile_get_property_enum (profile, TERMINAL_PROFILE_BACKGROUND_TYPE) == TERMINAL_BACKGROUND_TRANSPARENT)
alpha = terminal_profile_get_property_double (profile, TERMINAL_PROFILE_BACKGROUND_DARKNESS);
vte_terminal_set_colors (VTE_TERMINAL (screen),
gdk_color_to_rgba (&fg, 1.0, &fg_rgba),
gdk_color_to_rgba (&bg, alpha, &bg_rgba),
colors_rgba, n_colors);
if (bold_color)
vte_terminal_set_color_bold (VTE_TERMINAL (screen),
gdk_color_to_rgba (bold_color, 1.0, &bold_rgba));
}
#else
vte_terminal_set_colors (VTE_TERMINAL (screen), &fg, &bg, vte_terminal_set_colors (VTE_TERMINAL (screen), &fg, &bg,
colors, n_colors); colors, n_colors);
if (bold_color) if (bold_color)
vte_terminal_set_color_bold (VTE_TERMINAL (screen), bold_color); vte_terminal_set_color_bold (VTE_TERMINAL (screen), bold_color);
vte_terminal_set_background_tint_color (VTE_TERMINAL (screen), &bg); vte_terminal_set_background_tint_color (VTE_TERMINAL (screen), &bg);
#endif
} }
void void
@ -1502,7 +1572,12 @@ terminal_screen_launch_child_cb (TerminalScreen *screen)
pty_flags |= VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP; pty_flags |= VTE_PTY_NO_UTMP | VTE_PTY_NO_WTMP;
if (!get_child_command (screen, shell, &spawn_flags, &argv, &err) || if (!get_child_command (screen, shell, &spawn_flags, &argv, &err) ||
!vte_terminal_fork_command_full (terminal, #if VTE_CHECK_VERSION (0, 38, 0)
!vte_terminal_spawn_sync (
#else
!vte_terminal_fork_command_full (
#endif
terminal,
pty_flags, pty_flags,
working_dir, working_dir,
argv, argv,
@ -1510,6 +1585,9 @@ terminal_screen_launch_child_cb (TerminalScreen *screen)
spawn_flags, spawn_flags,
NULL, NULL, NULL, NULL,
&pid, &pid,
#if VTE_CHECK_VERSION (0, 38, 0)
NULL,
#endif
&err)) &err))
{ {
GtkWidget *info_bar; GtkWidget *info_bar;
@ -1620,14 +1698,19 @@ terminal_screen_button_press (GtkWidget *widget,
TerminalScreen *screen = TERMINAL_SCREEN (widget); TerminalScreen *screen = TERMINAL_SCREEN (widget);
gboolean (* button_press_event) (GtkWidget*, GdkEventButton*) = gboolean (* button_press_event) (GtkWidget*, GdkEventButton*) =
GTK_WIDGET_CLASS (terminal_screen_parent_class)->button_press_event; GTK_WIDGET_CLASS (terminal_screen_parent_class)->button_press_event;
int char_width, char_height, row, col;
char *matched_string; char *matched_string;
int matched_flavor = 0; int matched_flavor = 0;
guint state; guint state;
#if !VTE_CHECK_VERSION (0, 38, 0)
int char_width, char_height, row, col;
GtkBorder *inner_border = NULL; GtkBorder *inner_border = NULL;
#endif
state = event->state & gtk_accelerator_get_default_mod_mask (); state = event->state & gtk_accelerator_get_default_mod_mask ();
#if VTE_CHECK_VERSION (0, 38, 0)
matched_string = terminal_screen_check_match (screen, event, &matched_flavor);
#else
terminal_screen_get_cell_size (screen, &char_width, &char_height); terminal_screen_get_cell_size (screen, &char_width, &char_height);
gtk_widget_style_get (widget, "inner-border", &inner_border, NULL); gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
@ -1635,8 +1718,8 @@ terminal_screen_button_press (GtkWidget *widget,
col = (event->y - (inner_border ? inner_border->top : 0)) / char_height; col = (event->y - (inner_border ? inner_border->top : 0)) / char_height;
gtk_border_free (inner_border); gtk_border_free (inner_border);
/* FIXMEchpe: add vte API to do this check by widget coords instead of grid coords */
matched_string = terminal_screen_check_match (screen, row, col, &matched_flavor); matched_string = terminal_screen_check_match (screen, row, col, &matched_flavor);
#endif
if (matched_string != NULL && if (matched_string != NULL &&
(event->button == 1 || event->button == 2) && (event->button == 1 || event->button == 2) &&
@ -1872,7 +1955,11 @@ terminal_screen_icon_title_changed (VteTerminal *vte_terminal,
} }
static void static void
#if VTE_CHECK_VERSION (0, 38, 0)
terminal_screen_child_exited (VteTerminal *terminal, int status)
#else
terminal_screen_child_exited (VteTerminal *terminal) terminal_screen_child_exited (VteTerminal *terminal)
#endif
{ {
TerminalScreen *screen = TERMINAL_SCREEN (terminal); TerminalScreen *screen = TERMINAL_SCREEN (terminal);
TerminalScreenPrivate *priv = screen->priv; TerminalScreenPrivate *priv = screen->priv;
@ -1900,9 +1987,11 @@ terminal_screen_child_exited (VteTerminal *terminal)
case TERMINAL_EXIT_HOLD: case TERMINAL_EXIT_HOLD:
{ {
GtkWidget *info_bar; GtkWidget *info_bar;
#if !VTE_CHECK_VERSION (0, 38, 0)
int status; int status;
status = vte_terminal_get_child_exit_status (terminal); status = vte_terminal_get_child_exit_status (terminal);
#endif
info_bar = terminal_info_bar_new (GTK_MESSAGE_INFO, info_bar = terminal_info_bar_new (GTK_MESSAGE_INFO,
_("_Relaunch"), RESPONSE_RELAUNCH, _("_Relaunch"), RESPONSE_RELAUNCH,
@ -2269,8 +2358,12 @@ terminal_screen_skey_match_remove (TerminalScreen *screen)
static char* static char*
terminal_screen_check_match (TerminalScreen *screen, terminal_screen_check_match (TerminalScreen *screen,
#if VTE_CHECK_VERSION (0, 38, 0)
GdkEvent *event,
#else
int column, int column,
int row, int row,
#endif
int *flavor) int *flavor)
{ {
TerminalScreenPrivate *priv = screen->priv; TerminalScreenPrivate *priv = screen->priv;
@ -2278,7 +2371,11 @@ terminal_screen_check_match (TerminalScreen *screen,
int tag; int tag;
char *match; char *match;
#if VTE_CHECK_VERSION (0, 38, 0)
match = vte_terminal_match_check_event (VTE_TERMINAL (screen), event, &tag);
#else
match = vte_terminal_match_check (VTE_TERMINAL (screen), column, row, &tag); match = vte_terminal_match_check (VTE_TERMINAL (screen), column, row, &tag);
#endif
for (tags = priv->match_tags; tags != NULL; tags = tags->next) for (tags = priv->match_tags; tags != NULL; tags = tags->next)
{ {
TagData *tag_data = (TagData*) tags->data; TagData *tag_data = (TagData*) tags->data;

View File

@ -766,7 +766,11 @@ terminal_set_encoding_callback (GtkToggleAction *action,
g_assert (encoding); g_assert (encoding);
vte_terminal_set_encoding (VTE_TERMINAL (priv->active_screen), vte_terminal_set_encoding (VTE_TERMINAL (priv->active_screen),
#if VTE_CHECK_VERSION (0, 38, 0)
terminal_encoding_get_charset (encoding), NULL);
#else
terminal_encoding_get_charset (encoding)); terminal_encoding_get_charset (encoding));
#endif
} }
static void static void
@ -1056,6 +1060,7 @@ update_edit_menu(TerminalWindow *window)
g_object_ref (window)); g_object_ref (window));
} }
/* width and height are character-based in vte 0.38, pixel-based in previous versions */
static void static void
screen_resize_window_cb (TerminalScreen *screen, screen_resize_window_cb (TerminalScreen *screen,
guint width, guint width,
@ -1065,12 +1070,13 @@ screen_resize_window_cb (TerminalScreen *screen,
TerminalWindowPrivate *priv = window->priv; TerminalWindowPrivate *priv = window->priv;
VteTerminal *terminal = VTE_TERMINAL (screen); VteTerminal *terminal = VTE_TERMINAL (screen);
GtkWidget *widget = GTK_WIDGET (screen); GtkWidget *widget = GTK_WIDGET (screen);
#if !VTE_CHECK_VERSION (0, 38, 0)
guint grid_width, grid_height; guint grid_width, grid_height;
int char_width, char_height; int char_width, char_height;
GtkBorder *inner_border = NULL; GtkBorder *inner_border = NULL;
GtkAllocation widget_allocation; GtkAllocation widget_allocation;
#endif
gtk_widget_get_allocation (widget, &widget_allocation);
/* Don't do anything if we're maximised or fullscreened */ /* Don't do anything if we're maximised or fullscreened */
// FIXME: realized && ... instead? // FIXME: realized && ... instead?
if (!gtk_widget_get_realized (widget) || if (!gtk_widget_get_realized (widget) ||
@ -1079,6 +1085,11 @@ screen_resize_window_cb (TerminalScreen *screen,
/* NOTE: width and height already include the VteTerminal's padding! */ /* NOTE: width and height already include the VteTerminal's padding! */
#if VTE_CHECK_VERSION (0, 38, 0)
vte_terminal_set_size (terminal, width, height);
#else
gtk_widget_get_allocation (widget, &widget_allocation);
/* Short-circuit */ /* Short-circuit */
if (((int) width) == widget_allocation.width && if (((int) width) == widget_allocation.width &&
((int) height) == widget_allocation.height) ((int) height) == widget_allocation.height)
@ -1095,6 +1106,7 @@ screen_resize_window_cb (TerminalScreen *screen,
gtk_border_free (inner_border); gtk_border_free (inner_border);
vte_terminal_set_size (terminal, grid_width, grid_height); vte_terminal_set_size (terminal, grid_width, grid_height);
#endif
if (screen != priv->active_screen) if (screen != priv->active_screen)
return; return;
@ -1153,12 +1165,14 @@ terminal_window_update_tabs_menu_sensitivity (TerminalWindow *window)
gtk_action_set_sensitive (action, num_pages > 1); gtk_action_set_sensitive (action, num_pages > 1);
} }
#if !VTE_CHECK_VERSION (0, 38, 0)
gboolean gboolean
terminal_window_uses_argb_visual (TerminalWindow *window) terminal_window_uses_argb_visual (TerminalWindow *window)
{ {
TerminalWindowPrivate *priv = window->priv; TerminalWindowPrivate *priv = window->priv;
return priv->have_argb_visual; return priv->have_argb_visual;
} }
#endif
static void static void
update_tab_visibility (TerminalWindow *window, update_tab_visibility (TerminalWindow *window,
@ -1366,6 +1380,7 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
action = gtk_action_group_get_action (priv->action_group, "PopupInputMethods"); action = gtk_action_group_get_action (priv->action_group, "PopupInputMethods");
gtk_action_set_visible (action, show_input_method_menu); gtk_action_set_visible (action, show_input_method_menu);
#if !VTE_CHECK_VERSION (0, 38, 0)
im_menu_item = gtk_ui_manager_get_widget (priv->ui_manager, im_menu_item = gtk_ui_manager_get_widget (priv->ui_manager,
"/Popup/PopupInputMethods"); "/Popup/PopupInputMethods");
/* FIXME: fix this when gtk+ bug #500065 is done, use vte_terminal_im_merge_ui */ /* FIXME: fix this when gtk+ bug #500065 is done, use vte_terminal_im_merge_ui */
@ -1381,6 +1396,7 @@ popup_clipboard_targets_received_cb (GtkClipboard *clipboard,
{ {
gtk_menu_item_set_submenu (GTK_MENU_ITEM (im_menu_item), NULL); gtk_menu_item_set_submenu (GTK_MENU_ITEM (im_menu_item), NULL);
} }
#endif
popup_menu = gtk_ui_manager_get_widget (priv->ui_manager, "/Popup"); popup_menu = gtk_ui_manager_get_widget (priv->ui_manager, "/Popup");
g_signal_connect (popup_menu, "deactivate", g_signal_connect (popup_menu, "deactivate",
@ -3122,18 +3138,29 @@ terminal_window_update_geometry (TerminalWindow *window)
char_height != priv->old_char_height || char_height != priv->old_char_height ||
widget != (GtkWidget*) priv->old_geometry_widget) widget != (GtkWidget*) priv->old_geometry_widget)
{ {
GtkBorder *inner_border = NULL;
/* FIXME Since we're using xthickness/ythickness to compute /* FIXME Since we're using xthickness/ythickness to compute
* padding we need to change the hints when the theme changes. * padding we need to change the hints when the theme changes.
*/ */
#if VTE_CHECK_VERSION (0, 38, 0)
GtkBorder padding;
gtk_style_context_get_padding(gtk_widget_get_style_context(widget),
gtk_widget_get_state_flags(widget),
&padding);
hints.base_width = padding.left + padding.right;
hints.base_height = padding.top + padding.bottom;
#else
GtkBorder *inner_border = NULL;
gtk_widget_style_get (widget, "inner-border", &inner_border, NULL); gtk_widget_style_get (widget, "inner-border", &inner_border, NULL);
hints.base_width = (inner_border ? (inner_border->left + inner_border->right) : 0); hints.base_width = (inner_border ? (inner_border->left + inner_border->right) : 0);
hints.base_height = (inner_border ? (inner_border->top + inner_border->bottom) : 0); hints.base_height = (inner_border ? (inner_border->top + inner_border->bottom) : 0);
gtk_border_free (inner_border); gtk_border_free (inner_border);
#endif
#define MIN_WIDTH_CHARS 4 #define MIN_WIDTH_CHARS 4
#define MIN_HEIGHT_CHARS 1 #define MIN_HEIGHT_CHARS 1
@ -3769,7 +3796,11 @@ search_find_response_callback (GtkWidget *dialog,
flags = terminal_search_dialog_get_search_flags (dialog); flags = terminal_search_dialog_get_search_flags (dialog);
#if VTE_CHECK_VERSION (0, 38, 0)
vte_terminal_search_set_gregex (VTE_TERMINAL (priv->active_screen), regex, 0);
#else
vte_terminal_search_set_gregex (VTE_TERMINAL (priv->active_screen), regex); vte_terminal_search_set_gregex (VTE_TERMINAL (priv->active_screen), regex);
#endif
vte_terminal_search_set_wrap_around (VTE_TERMINAL (priv->active_screen), vte_terminal_search_set_wrap_around (VTE_TERMINAL (priv->active_screen),
(flags & TERMINAL_SEARCH_FLAG_WRAP_AROUND)); (flags & TERMINAL_SEARCH_FLAG_WRAP_AROUND));
@ -3840,7 +3871,11 @@ search_clear_highlight_callback (GtkAction *action,
if (G_UNLIKELY (!window->priv->active_screen)) if (G_UNLIKELY (!window->priv->active_screen))
return; return;
#if VTE_CHECK_VERSION (0, 38, 0)
vte_terminal_search_set_gregex (VTE_TERMINAL (window->priv->active_screen), NULL, 0);
#else
vte_terminal_search_set_gregex (VTE_TERMINAL (window->priv->active_screen), NULL); vte_terminal_search_set_gregex (VTE_TERMINAL (window->priv->active_screen), NULL);
#endif
} }
static void static void

View File

@ -95,7 +95,9 @@ void terminal_window_set_size_force_grid (TerminalWindow *window,
GtkWidget* terminal_window_get_notebook (TerminalWindow *window); GtkWidget* terminal_window_get_notebook (TerminalWindow *window);
#if !VTE_CHECK_VERSION (0, 38, 0)
gboolean terminal_window_uses_argb_visual (TerminalWindow *window); gboolean terminal_window_uses_argb_visual (TerminalWindow *window);
#endif
void terminal_window_save_state (TerminalWindow *window, void terminal_window_save_state (TerminalWindow *window,
GKeyFile *key_file, GKeyFile *key_file,