diff options
Diffstat (limited to 'src/terminal-window.c')
-rw-r--r-- | src/terminal-window.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/src/terminal-window.c b/src/terminal-window.c index 3b8dc97..9033cb4 100644 --- a/src/terminal-window.c +++ b/src/terminal-window.c @@ -766,7 +766,11 @@ terminal_set_encoding_callback (GtkToggleAction *action, g_assert (encoding); 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)); +#endif } static void @@ -1056,6 +1060,7 @@ update_edit_menu(TerminalWindow *window) g_object_ref (window)); } +/* width and height are character-based in vte 0.38, pixel-based in previous versions */ static void screen_resize_window_cb (TerminalScreen *screen, guint width, @@ -1065,12 +1070,13 @@ screen_resize_window_cb (TerminalScreen *screen, TerminalWindowPrivate *priv = window->priv; VteTerminal *terminal = VTE_TERMINAL (screen); GtkWidget *widget = GTK_WIDGET (screen); +#if !VTE_CHECK_VERSION (0, 38, 0) guint grid_width, grid_height; int char_width, char_height; GtkBorder *inner_border = NULL; GtkAllocation widget_allocation; +#endif - gtk_widget_get_allocation (widget, &widget_allocation); /* Don't do anything if we're maximised or fullscreened */ // FIXME: realized && ... instead? 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! */ +#if VTE_CHECK_VERSION (0, 38, 0) + vte_terminal_set_size (terminal, width, height); +#else + gtk_widget_get_allocation (widget, &widget_allocation); + /* Short-circuit */ if (((int) width) == widget_allocation.width && ((int) height) == widget_allocation.height) @@ -1095,6 +1106,7 @@ screen_resize_window_cb (TerminalScreen *screen, gtk_border_free (inner_border); vte_terminal_set_size (terminal, grid_width, grid_height); +#endif if (screen != priv->active_screen) return; @@ -1153,12 +1165,14 @@ terminal_window_update_tabs_menu_sensitivity (TerminalWindow *window) gtk_action_set_sensitive (action, num_pages > 1); } +#if !VTE_CHECK_VERSION (0, 38, 0) gboolean terminal_window_uses_argb_visual (TerminalWindow *window) { TerminalWindowPrivate *priv = window->priv; return priv->have_argb_visual; } +#endif static void 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"); 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, "/Popup/PopupInputMethods"); /* 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); } +#endif popup_menu = gtk_ui_manager_get_widget (priv->ui_manager, "/Popup"); g_signal_connect (popup_menu, "deactivate", @@ -3122,18 +3138,29 @@ terminal_window_update_geometry (TerminalWindow *window) char_height != priv->old_char_height || widget != (GtkWidget*) priv->old_geometry_widget) { - GtkBorder *inner_border = NULL; - /* FIXME Since we're using xthickness/ythickness to compute * 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); hints.base_width = (inner_border ? (inner_border->left + inner_border->right) : 0); hints.base_height = (inner_border ? (inner_border->top + inner_border->bottom) : 0); gtk_border_free (inner_border); +#endif #define MIN_WIDTH_CHARS 4 #define MIN_HEIGHT_CHARS 1 @@ -3769,7 +3796,11 @@ search_find_response_callback (GtkWidget *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); +#endif vte_terminal_search_set_wrap_around (VTE_TERMINAL (priv->active_screen), (flags & TERMINAL_SEARCH_FLAG_WRAP_AROUND)); @@ -3840,7 +3871,11 @@ search_clear_highlight_callback (GtkAction *action, if (G_UNLIKELY (!window->priv->active_screen)) 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); +#endif } static void |