]> git.pld-linux.org Git - packages/vim.git/blob - 6.2.239
- fix for current libselinux
[packages/vim.git] / 6.2.239
1 To: vim-dev@vim.org
2 Subject: Patch 6.2.239
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
8 ------------
9
10 Patch 6.2.239
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
16
17
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
20 ***************
21 *** 1103,1117 ****
22        * working in later GTK versions.
23        *
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.
29        */
30       if (sb != NULL)
31       {
32   #ifdef HAVE_GTK2
33         dragging = TRUE;
34   #else
35         dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
36   #endif
37 --- 1108,1149 ----
38        * working in later GTK versions.
39        *
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!
43        */
44       if (sb != NULL)
45       {
46   #ifdef HAVE_GTK2
47         dragging = TRUE;
48
49 +       if (sb->wp != NULL)
50 +       {
51 +           int                 x;
52 +           int                 y;
53 +           GdkModifierType     state;
54 +           int                 width;
55 +           int                 height;
56
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)
62 +           {
63 +               if (y < width)
64 +               {
65 +                   /* up arrow: move one (closed fold) line up */
66 +                   dragging = FALSE;
67 +                   value = sb->wp->w_topline - 2;
68 +               }
69 +               else if (y > height - width)
70 +               {
71 +                   /* down arrow: move one (closed fold) line down */
72 +                   dragging = FALSE;
73 +                   value = sb->wp->w_topline;
74 +               }
75 +           }
76 +       }
77   #else
78         dragging = (GTK_RANGE(sb->id)->scroll_type == GTK_SCROLL_NONE);
79   #endif
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
82 ***************
83 *** 3294,3300 ****
84 --- 3294,3307 ----
85         gui.dragged_wp = sb->wp;
86       }
87       else
88 +     {
89         gui.dragged_sb = SBAR_NONE;
90 + #ifdef HAVE_GTK2
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;
94 + #endif
95 +     }
96   
97       /* Vertical sbar info is kept in the first sbar (the left one) */
98       if (sb->wp != NULL)
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
101 ***************
102 *** 639,640 ****
103 --- 639,642 ----
104   {   /* Add new patch number below this line */
105 + /**/
106 +     239,
107   /**/
108
109 -- 
110 hundred-and-one symptoms of being an internet addict:
111 63. You start using smileys in your snail mail.
112
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  ///
This page took 0.041318 seconds and 3 git commands to generate.