[vte/vte-0-36] widget: Immediately resize the ring on app-initiated window resize



commit b2f437c67847647e892495f9b1656ac29a6bdc86
Author: Egmont Koblinger <egmont gmail com>
Date:   Thu May 22 22:28:59 2014 +0200

    widget: Immediately resize the ring on app-initiated window resize
    
    https://bugzilla.gnome.org/show_bug.cgi?id=647466
    (cherry picked from commit 4425ee077bbedb1337e2e7d332e1137e68fd4adf)

 src/vte.c |   37 ++++++++++++++++---------------------
 1 files changed, 16 insertions(+), 21 deletions(-)
---
diff --git a/src/vte.c b/src/vte.c
index 9d8f933..ef58a31 100644
--- a/src/vte.c
+++ b/src/vte.c
@@ -8274,6 +8274,7 @@ vte_terminal_screen_set_size(VteTerminal *terminal, VteScreen *screen, glong old
 void
 vte_terminal_set_size(VteTerminal *terminal, glong columns, glong rows)
 {
+       VteScreen *screen;
        glong old_columns, old_rows;
 
        g_return_if_fail(VTE_IS_TERMINAL(terminal));
@@ -8310,6 +8311,21 @@ vte_terminal_set_size(VteTerminal *terminal, glong columns, glong rows)
                if (terminal->pvt->screen == &terminal->pvt->alternate_screen)
                        vte_terminal_screen_set_size(terminal, &terminal->pvt->alternate_screen, old_columns, 
old_rows, FALSE);
 
+                /* Ensure scrollback buffers cover the screen. */
+                vte_terminal_set_scrollback_lines(terminal,
+                                                  terminal->pvt->scrollback_lines);
+                /* Ensure the cursor is valid */
+                screen = &terminal->pvt->normal_screen;
+                screen->cursor_current.row = CLAMP (screen->cursor_current.row,
+                                                    _vte_ring_delta (screen->row_data),
+                                                    MAX (_vte_ring_delta (screen->row_data),
+                                                         _vte_ring_next (screen->row_data) - 1));
+                screen = &terminal->pvt->alternate_screen;
+                screen->cursor_current.row = CLAMP (screen->cursor_current.row,
+                                                    _vte_ring_delta (screen->row_data),
+                                                    MAX (_vte_ring_delta (screen->row_data),
+                                                         _vte_ring_next (screen->row_data) - 1));
+
                _vte_terminal_adjust_adjustments_full (terminal);
                gtk_widget_queue_resize_no_redraw (&terminal->widget);
                /* Our visible text changed. */
@@ -8837,30 +8853,9 @@ vte_terminal_size_allocate(GtkWidget *widget, GtkAllocation *allocation)
                        || height != terminal->row_count
                        || update_scrollback)
        {
-               VteScreen *screen = terminal->pvt->screen;
-
                /* Set the size of the pseudo-terminal. */
                vte_terminal_set_size(terminal, width, height);
 
-               /* Adjust scrolling area in case our boundaries have just been
-                * redefined to be invalid. */
-               if (screen->scrolling_restricted) {
-                       screen->scrolling_region.start =
-                               MIN(screen->scrolling_region.start,
-                                               terminal->row_count - 1);
-                       screen->scrolling_region.end =
-                               MIN(screen->scrolling_region.end,
-                                               terminal->row_count - 1);
-               }
-
-               /* Ensure scrollback buffers cover the screen. */
-               vte_terminal_set_scrollback_lines(terminal,
-                               terminal->pvt->scrollback_lines);
-               /* Ensure the cursor is valid */
-               screen->cursor_current.row = CLAMP (screen->cursor_current.row,
-                               _vte_ring_delta (screen->row_data),
-                               MAX (_vte_ring_delta (screen->row_data),
-                                       _vte_ring_next (screen->row_data) - 1));
                /* Notify viewers that the contents have changed. */
                _vte_terminal_queue_contents_changed(terminal);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]