[gnome-terminal] screen: Update for vte API
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal] screen: Update for vte API
- Date: Fri, 18 Apr 2014 09:45:24 +0000 (UTC)
commit 859acba165e94d5933bff938019230c5d1b8d2de
Author: Christian Persch <chpe gnome org>
Date: Mon Mar 24 21:02:28 2014 +0100
screen: Update for vte API
Corresponding to vte commit 371f90d40fa9b3331c3e10bab91bec4a63809a0b.
src/terminal-window.c | 35 ++++-------------------------------
1 files changed, 4 insertions(+), 31 deletions(-)
---
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 93145ac..75bce5c 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1771,45 +1771,18 @@ update_edit_menu (GtkClipboard *clipboard,
static void
screen_resize_window_cb (TerminalScreen *screen,
- guint width,
- guint height,
+ guint columns,
+ guint rows,
TerminalWindow* window)
{
TerminalWindowPrivate *priv = window->priv;
- VteTerminal *terminal = VTE_TERMINAL (screen);
GtkWidget *widget = GTK_WIDGET (screen);
- guint grid_width, grid_height;
- int char_width, char_height;
- GtkAllocation widget_allocation;
- GtkBorder padding;
- 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) ||
+ if (gtk_widget_get_realized (widget) &&
(gdk_window_get_state (gtk_widget_get_window (widget)) & (GDK_WINDOW_STATE_MAXIMIZED |
GDK_WINDOW_STATE_FULLSCREEN)) != 0)
return;
- /* NOTE: width and height already include the VteTerminal's padding! */
-
- /* Short-circuit */
- if (((int) width) == widget_allocation.width &&
- ((int) height) == widget_allocation.height)
- return;
-
- /* The resize-window signal sucks. Re-compute grid widths */
-
- char_width = vte_terminal_get_char_width (terminal);
- char_height = vte_terminal_get_char_height (terminal);
-
- gtk_style_context_get_padding(gtk_widget_get_style_context(GTK_WIDGET(terminal)),
- gtk_widget_get_state_flags(widget),
- &padding);
-
- grid_width = (width - padding.left) / char_width;
- grid_height = (height - padding.top) / char_height;
-
- vte_terminal_set_size (terminal, grid_width, grid_height);
+ vte_terminal_set_size (VTE_TERMINAL (priv->active_screen), columns, rows);
if (screen == priv->active_screen)
terminal_window_update_size (window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]