diff options
Diffstat (limited to 'x11-libs/vte/files/vte-line-scroll.patch')
-rw-r--r-- | x11-libs/vte/files/vte-line-scroll.patch | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/x11-libs/vte/files/vte-line-scroll.patch b/x11-libs/vte/files/vte-line-scroll.patch new file mode 100644 index 000000000000..ad5f878530f7 --- /dev/null +++ b/x11-libs/vte/files/vte-line-scroll.patch @@ -0,0 +1,57 @@ +--- vte.c.ORG 2004-03-06 10:28:09.000000000 -0800 ++++ vte.c 2004-03-06 10:44:23.000000000 -0800 +@@ -1917,4 +1917,31 @@ + } + ++/* Scroll up or down in the current screen. */ ++static void ++vte_terminal_scroll_lines(VteTerminal *terminal, gint lines) ++{ ++ glong destination; ++ g_return_if_fail(VTE_IS_TERMINAL(terminal)); ++#ifdef VTE_DEBUG ++ if (_vte_debug_on(VTE_DEBUG_IO)) { ++ fprintf(stderr, "Scrolling %d lines.\n", lines); ++ } ++#endif ++ /* Calculate the ideal position where we want to be before clamping. */ ++ destination = floor(gtk_adjustment_get_value(terminal->adjustment)); ++ destination += lines; ++ /* Can't scroll past data we have. */ ++ destination = CLAMP(destination, ++ terminal->adjustment->lower, ++ terminal->adjustment->upper - terminal->row_count); ++ /* Tell the scrollbar to adjust itself. */ ++ gtk_adjustment_set_value(terminal->adjustment, destination); ++ /* Clear dingus match set. */ ++ vte_terminal_match_contents_clear(terminal); ++ /* Notify viewers that the contents have changed. */ ++ vte_terminal_emit_contents_changed(terminal); ++} ++ ++ + /* Scroll so that the scroll delta is the minimum value. */ + static void +@@ -8038,4 +8065,22 @@ + } + break; ++ case GDK_KP_Up: ++ case GDK_Up: ++ if (terminal->pvt->modifiers & GDK_SHIFT_MASK) { ++ vte_terminal_scroll_lines(terminal, -1); ++ scrolled = TRUE; ++ handled = TRUE; ++ suppress_meta_esc = TRUE; ++ } ++ break; ++ case GDK_KP_Down: ++ case GDK_Down: ++ if (terminal->pvt->modifiers & GDK_SHIFT_MASK) { ++ vte_terminal_scroll_lines(terminal, 1); ++ scrolled = TRUE; ++ handled = TRUE; ++ suppress_meta_esc = TRUE; ++ } ++ break; + case GDK_KP_Home: + case GDK_Home: |