diff options
author | Christian Persch <chpe@gnome.org> | 2013-09-30 23:00:09 +0200 |
---|---|---|
committer | Christian Persch <chpe@gnome.org> | 2013-09-30 23:04:52 +0200 |
commit | 9f8c1b88dcd880c2d9e78c93521ee755560a9275 (patch) | |
tree | 53eaf341e15569e146d4edce565a134d54e112ba /src/vte.c | |
parent | ed5adb65a132b1c0e5054618fc989f76955a7e00 (diff) | |
download | vte-9f8c1b88dcd880c2d9e78c93521ee755560a9275.tar.gz |
emulation: Add support for DEC 1007 to set the alternate scroll mode
By default, the mouse wheel sends cursor up/down keycodes in the
alternate screen. This adds an escape sequence (DEC 1007) that allows
turning this off (and on again).
For compatibility with ubuntu's ******** patched vte, also add a
(deprecated, skip) public API that has the expected name but does nothing.
Based on patches from ubuntu, and Egmont Koblinger.
https://bugzilla.gnome.org/show_bug.cgi?id=518405
https://bugzilla.gnome.org/show_bug.cgi?id=709060
Diffstat (limited to 'src/vte.c')
-rw-r--r-- | src/vte.c | 24 |
1 files changed, 22 insertions, 2 deletions
@@ -8495,6 +8495,7 @@ vte_terminal_init(VteTerminal *terminal) /* Scrolling options. */ pvt->scroll_on_keystroke = TRUE; + pvt->alternate_screen_scroll = TRUE; pvt->scrollback_lines = -1; /* force update in vte_terminal_set_scrollback_lines */ vte_terminal_set_scrollback_lines(terminal, VTE_SCROLLBACK_INIT); @@ -8544,6 +8545,8 @@ vte_terminal_init(VteTerminal *terminal) pvt->has_fonts = FALSE; pvt->root_pixmap_changed_tag = 0; + pvt->alternate_screen_scroll = TRUE; + /* Not all backends generate GdkVisibilityNotify, so mark the * window as unobscured initially. */ pvt->visibility_state = GDK_VISIBILITY_UNOBSCURED; @@ -11403,8 +11406,9 @@ vte_terminal_scroll(GtkWidget *widget, GdkEventScroll *event) return FALSE; } - if (terminal->pvt->screen == &terminal->pvt->alternate_screen || - terminal->pvt->normal_screen.scrolling_restricted) { + if ((terminal->pvt->screen == &terminal->pvt->alternate_screen && + terminal->pvt->alternate_screen_scroll) || + terminal->pvt->normal_screen.scrolling_restricted) { char *normal; gssize normal_length; const gchar *special; @@ -13153,6 +13157,20 @@ vte_terminal_set_scroll_on_keystroke(VteTerminal *terminal, gboolean scroll) g_object_notify (G_OBJECT (terminal), "scroll-on-keystroke"); } +/** + * vte_terminal_set_alternate_screen_scroll: (skip): + * @terminal: a #VteTerminal + * @scroll: + * + * Since: 0.36 + * Deprecated: 0.36: This function does nothing. + */ +void +vte_terminal_set_alternate_screen_scroll(VteTerminal *terminal, gboolean scroll) +{ + /* We just want to export this symbol for compatibility */ +} + static void vte_terminal_real_copy_clipboard(VteTerminal *terminal) { @@ -14174,6 +14192,8 @@ vte_terminal_reset(VteTerminal *terminal, pvt->alternate_screen.reverse_mode = FALSE; pvt->alternate_screen.bracketed_paste_mode = FALSE; pvt->cursor_visible = TRUE; + /* For some reason, xterm doesn't reset alternateScroll, but we do. */ + pvt->alternate_screen_scroll = TRUE; /* Reset the encoding. */ vte_terminal_set_encoding(terminal, NULL); g_assert(pvt->encoding != NULL); |