4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: GTK 2: With closed folds the arrow buttons of a vertical scrollbar
12 often doesn't scroll. (Moshe Kaminsky)
13 Solution: Hackish solution: Detect that the button was pressed from the
14 mouse pointer position.
15 Files: src/gui_gtk.c, src/gui.c
18 *** ../vim-6.2.238/src/gui_gtk.c Sun Jan 11 12:45:02 2004
19 --- src/gui_gtk.c Fri Feb 6 15:22:50 2004
22 * working in later GTK versions.
24 * FIXME: Well, it doesn't work in GTK2. :)
25 ! * OK, I experimented with GTK_WIDGET_HAS_GRAB() and it seemed to work
26 ! * to some extent. But simply setting dragging = TRUE all the time
27 ! * seems to work better :/ We also need to #define USE_ON_FLY_SCROLL
28 ! * for GTK+ 2, thus things do work substantially different.
35 dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
38 * working in later GTK versions.
40 * FIXME: Well, it doesn't work in GTK2. :)
41 ! * HACK: Get the mouse pointer position, if it appears to be on an arrow
42 ! * button set "dragging" to FALSE. This assumes square buttons!
53 + GdkModifierType state;
57 + /* vertical scrollbar: need to set "dragging" properly in case
58 + * there are closed folds. */
59 + gdk_window_get_pointer(sb->id->window, &x, &y, &state);
60 + gdk_window_get_size(sb->id->window, &width, &height);
61 + if (x >= 0 && x < width && y >= 0 && y < height)
65 + /* up arrow: move one (closed fold) line up */
67 + value = sb->wp->w_topline - 2;
69 + else if (y > height - width)
71 + /* down arrow: move one (closed fold) line down */
73 + value = sb->wp->w_topline;
78 dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
80 *** ../vim-6.2.238/src/gui.c Sun Jan 25 20:45:55 2004
81 --- src/gui.c Thu Feb 5 20:15:58 2004
85 gui.dragged_wp = sb->wp;
89 gui.dragged_sb = SBAR_NONE;
91 + /* Keep the "dragged_wp" value until after the scrolling, for when the
92 + * moust button is released. GTK2 doesn't send the button-up event. */
93 + gui.dragged_wp = NULL;
97 /* Vertical sbar info is kept in the first sbar (the left one) */
99 *** ../vim-6.2.238/src/version.c Thu Feb 5 16:04:27 2004
100 --- src/version.c Fri Feb 6 19:17:11 2004
104 { /* Add new patch number below this line */
110 hundred-and-one symptoms of being an internet addict:
111 63. You start using smileys in your snail mail.
113 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
114 /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
115 \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
116 \\\ Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html ///