To: vim-dev@vim.org Subject: Patch 6.1.460 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.460 Problem: GTK: after scrolling the text one line with a key, clicking the arrow of the scrollbar does not always work. (Nam SungHyun) Solution: Always update the scrollbar thumb when the value changed, even when it would not move, like for RISCOS. (Daniel Elstner) Files: src/gui.c, src/gui.h *** ../vim61.459/src/gui.c Sun Apr 6 22:24:35 2003 --- src/gui.c Sun Apr 6 21:47:48 2003 *************** *** 3053,3059 **** --- 3053,3061 ---- sb->wp = wp; sb->type = type; sb->value = 0; + #ifdef FEAT_GUI_ATHENA sb->pixval = 0; + #endif sb->size = 1; sb->max = 1; sb->top = 0; *************** *** 3458,3479 **** } } ! /* reduce the number of calls to gui_mch_set_scrollbar_thumb() by ! * checking if the thumb moved at least a pixel */ if (max == 0) y = 0; else y = (val * (sb->height + 2) * gui.char_height + max / 2) / max; - #ifndef RISCOS - /* RISCOS does scrollbars differently - if the position through the - * file has changed then we must update the scrollbar regardless of - * how far we think it has moved. */ if (force || sb->pixval != y || sb->size != size || sb->max != max) #endif { /* Thumb of scrollbar has moved */ sb->value = val; sb->pixval = y; sb->size = size; sb->max = max; if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT) --- 3460,3484 ---- } } ! /* Reduce the number of calls to gui_mch_set_scrollbar_thumb() by ! * checking if the thumb moved at least a pixel. Only do this for ! * Athena, most other GUIs require the update anyway to make the ! * arrows work. */ ! #ifdef FEAT_GUI_ATHENA if (max == 0) y = 0; else y = (val * (sb->height + 2) * gui.char_height + max / 2) / max; if (force || sb->pixval != y || sb->size != size || sb->max != max) + #else + if (force || sb->value != val || sb->size != size || sb->max != max) #endif { /* Thumb of scrollbar has moved */ sb->value = val; + #ifdef FEAT_GUI_ATHENA sb->pixval = y; + #endif sb->size = size; sb->max = max; if (gui.which_scrollbars[SBAR_LEFT] && gui.dragged_sb != SBAR_LEFT) *** ../vim61.459/src/gui.h Tue Mar 11 12:59:06 2003 --- src/gui.h Sun Apr 6 13:54:04 2003 *************** *** 182,188 **** --- 182,190 ---- struct window *wp; /* Scrollbar's window, NULL for bottom */ int type; /* one of SBAR_{LEFT,RIGHT,BOTTOM} */ long value; /* Represents top line number visible */ + #ifdef FEAT_GUI_ATHENA int pixval; /* pixel count of value */ + #endif long size; /* Size of scrollbar thumb */ long max; /* Number of lines in buffer */ *** ../vim61.459/src/version.c Sun Apr 13 20:26:05 2003 --- src/version.c Sun Apr 13 20:29:02 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 460, /**/ -- ARTHUR: I've said I'm sorry about the old woman, but from the behind you looked ... DENNIS: What I object to is that you automatically treat me like an inferior... ARTHUR: Well ... I AM king. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///