From c74d1e3c6a0aa2c4ef275e18fcdc5844f536bab6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 26 Nov 2017 09:16:22 +0000 Subject: [PATCH] GTK1 runtime fix: widen extent of ignore_sbar. ignore_sbar is a flag that we set while manually changing the scrollbar settings, so that when those half-finished changes trigger GTK event callbacks, we know to ignore them, and wait until we've finished setting everything up before actually updating the window. But somehow I had managed to leave the functions that actually _have the effect_ (at least in GTK1) outside the pair of statements that set and unset the ignore flag. The effect was that compiling pterm for GTK1, starting it up, and issuing a command like 'ls -l' that scrolls off the bottom of the window would lead to the _top_ half of the ls output being visible, and the scrollbar at the top of the scrollback rather than the bottom. --- unix/gtkwin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unix/gtkwin.c b/unix/gtkwin.c index a851c258..1038e756 100644 --- a/unix/gtkwin.c +++ b/unix/gtkwin.c @@ -2884,13 +2884,13 @@ void set_sbar(void *frontend, int total, int start, int page) struct gui_data *inst = (struct gui_data *)frontend; if (!conf_get_int(inst->conf, CONF_scrollbar)) return; + inst->ignore_sbar = TRUE; gtk_adjustment_set_lower(inst->sbar_adjust, 0); gtk_adjustment_set_upper(inst->sbar_adjust, total); gtk_adjustment_set_value(inst->sbar_adjust, start); gtk_adjustment_set_page_size(inst->sbar_adjust, page); gtk_adjustment_set_step_increment(inst->sbar_adjust, 1); gtk_adjustment_set_page_increment(inst->sbar_adjust, page/2); - inst->ignore_sbar = TRUE; #if !GTK_CHECK_VERSION(3,18,0) gtk_adjustment_changed(inst->sbar_adjust); #endif