]>
Commit | Line | Data |
---|---|---|
ad28a8ff AG |
1 | To: vim-dev@vim.org |
2 | Subject: patch 7.1.007 (extra) | |
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 7.1.007 (extra) | |
11 | Problem: Mac: Context menu doesn't work on Intel Macs. | |
12 | Scrollbars are not dimmed when Vim is not the active application. | |
13 | Solution: Remove the test whether context menus are supported. They are | |
14 | always there in OS/X. Handle the dimming. (Nicolas Weber) | |
15 | Files: src/gui_mac.c, src/gui.h | |
16 | ||
17 | ||
18 | *** ../vim-7.1.006/src/gui_mac.c Thu May 10 20:07:25 2007 | |
19 | --- src/gui_mac.c Sat Jun 9 14:19:25 2007 | |
20 | *************** | |
21 | *** 1676,1688 **** | |
22 | /* TODO: NEEDED? */ | |
23 | clickIsPopup = FALSE; | |
24 | ||
25 | ! if ((gui.MacOSHaveCntxMenu) && (mouse_model_popup())) | |
26 | ! if (IsShowContextualMenuClick(theEvent)) | |
27 | ! { | |
28 | ! vimMouseButton = MOUSE_RIGHT; | |
29 | ! vimModifiers &= ~MOUSE_CTRL; | |
30 | ! clickIsPopup = TRUE; | |
31 | ! } | |
32 | ||
33 | /* Is it a double click ? */ | |
34 | dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); | |
35 | --- 1676,1687 ---- | |
36 | /* TODO: NEEDED? */ | |
37 | clickIsPopup = FALSE; | |
38 | ||
39 | ! if (mouse_model_popup() && IsShowContextualMenuClick(theEvent)) | |
40 | ! { | |
41 | ! vimMouseButton = MOUSE_RIGHT; | |
42 | ! vimModifiers &= ~MOUSE_CTRL; | |
43 | ! clickIsPopup = TRUE; | |
44 | ! } | |
45 | ||
46 | /* Is it a double click ? */ | |
47 | dblClick = ((theEvent->when - lastMouseTick) < GetDblTime()); | |
48 | *************** | |
49 | *** 1920,1943 **** | |
50 | WindowPtr whichWindow; | |
51 | ||
52 | whichWindow = (WindowPtr) event->message; | |
53 | ! if ((event->modifiers) & activeFlag) | |
54 | ! /* Activate */ | |
55 | ! gui_focus_change(TRUE); | |
56 | ! else | |
57 | { | |
58 | ! /* Deactivate */ | |
59 | ! gui_focus_change(FALSE); | |
60 | ! /* DON'T KNOW what the code below was doing | |
61 | ! found in the deactivate clause, but the | |
62 | ! clause writing TRUE into in_focus (BUG) | |
63 | ! */ | |
64 | ! | |
65 | ! #if 0 /* Removed by Dany as per above June 2001 */ | |
66 | ! a_bool = false; | |
67 | ! SetPreserveGlyph(a_bool); | |
68 | ! SetOutlinePreferred(a_bool); | |
69 | ! #endif | |
70 | } | |
71 | } | |
72 | ||
73 | ||
74 | --- 1919,1937 ---- | |
75 | WindowPtr whichWindow; | |
76 | ||
77 | whichWindow = (WindowPtr) event->message; | |
78 | ! /* Dim scrollbars */ | |
79 | ! if (whichWindow == gui.VimWindow) | |
80 | { | |
81 | ! ControlRef rootControl; | |
82 | ! GetRootControl(gui.VimWindow, &rootControl); | |
83 | ! if ((event->modifiers) & activeFlag) | |
84 | ! ActivateControl(rootControl); | |
85 | ! else | |
86 | ! DeactivateControl(rootControl); | |
87 | } | |
88 | + | |
89 | + /* Activate */ | |
90 | + gui_focus_change((event->modifiers) & activeFlag); | |
91 | } | |
92 | ||
93 | ||
94 | *************** | |
95 | *** 2559,2574 **** | |
96 | OSErr error; | |
97 | ||
98 | /* Handle contextual menu right now (if needed) */ | |
99 | ! if (gui.MacOSHaveCntxMenu) | |
100 | ! if (IsShowContextualMenuClick(event)) | |
101 | ! { | |
102 | # if 0 | |
103 | ! gui_mac_handle_contextual_menu(event); | |
104 | # else | |
105 | ! gui_mac_doMouseDownEvent(event); | |
106 | # endif | |
107 | ! return; | |
108 | ! } | |
109 | ||
110 | /* Handle normal event */ | |
111 | switch (event->what) | |
112 | --- 2553,2567 ---- | |
113 | OSErr error; | |
114 | ||
115 | /* Handle contextual menu right now (if needed) */ | |
116 | ! if (IsShowContextualMenuClick(event)) | |
117 | ! { | |
118 | # if 0 | |
119 | ! gui_mac_handle_contextual_menu(event); | |
120 | # else | |
121 | ! gui_mac_doMouseDownEvent(event); | |
122 | # endif | |
123 | ! return; | |
124 | ! } | |
125 | ||
126 | /* Handle normal event */ | |
127 | switch (event->what) | |
128 | *************** | |
129 | *** 2782,2795 **** | |
130 | (void) InstallAEHandlers(); | |
131 | #endif | |
132 | ||
133 | - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) | |
134 | - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); | |
135 | - else | |
136 | - gui.MacOSHaveCntxMenu = false; | |
137 | - | |
138 | - if (gui.MacOSHaveCntxMenu) | |
139 | - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); | |
140 | - | |
141 | pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ | |
142 | ||
143 | AppendMenu(pomme, "\pAbout VIM"); | |
144 | --- 2775,2780 ---- | |
145 | *************** | |
146 | *** 2941,2946 **** | |
147 | --- 2926,2932 ---- | |
148 | #ifdef USE_CARBONKEYHANDLER | |
149 | EventHandlerRef keyEventHandlerRef; | |
150 | #endif | |
151 | + ControlRef rootControl; | |
152 | ||
153 | if (Gestalt(gestaltSystemVersion, &gMacSystemVersion) != noErr) | |
154 | gMacSystemVersion = 0x1000; /* TODO: Default to minimum sensible value */ | |
155 | *************** | |
156 | *** 2954,2968 **** | |
157 | (void) InstallAEHandlers(); | |
158 | #endif | |
159 | ||
160 | - /* Ctrl click */ | |
161 | - if (Gestalt(gestaltContextualMenuAttr, &gestalt_rc) == noErr) | |
162 | - gui.MacOSHaveCntxMenu = BitTst(&gestalt_rc, 31-gestaltContextualMenuTrapAvailable); | |
163 | - else | |
164 | - gui.MacOSHaveCntxMenu = false; | |
165 | - | |
166 | - if (gui.MacOSHaveCntxMenu) | |
167 | - gui.MacOSHaveCntxMenu = (InitContextualMenus()==noErr); | |
168 | - | |
169 | pomme = NewMenu(256, "\p\024"); /* 0x14= = Apple Menu */ | |
170 | ||
171 | AppendMenu(pomme, "\pAbout VIM"); | |
172 | --- 2940,2945 ---- | |
173 | *************** | |
174 | *** 2981,2986 **** | |
175 | --- 2958,2964 ---- | |
176 | gui.VimWindow = NewCWindow(nil, &windRect, "\pgVim on Macintosh", true, | |
177 | zoomDocProc, | |
178 | (WindowPtr)-1L, true, 0); | |
179 | + CreateRootControl(gui.VimWindow, &rootControl); | |
180 | InstallReceiveHandler((DragReceiveHandlerUPP)receiveHandler, | |
181 | gui.VimWindow, NULL); | |
182 | SetPortWindowPort(gui.VimWindow); | |
183 | *** ../vim-7.1.006/src/gui.h Thu May 10 19:18:46 2007 | |
184 | --- src/gui.h Sat Jun 9 14:10:34 2007 | |
185 | *************** | |
186 | *** 460,466 **** | |
187 | WindowPtr VimWindow; | |
188 | MenuHandle MacOSHelpMenu; /* Help menu provided by the MacOS */ | |
189 | int MacOSHelpItems; /* Nr of help-items supplied by MacOS */ | |
190 | - int MacOSHaveCntxMenu; /* Contextual menu available */ | |
191 | WindowPtr wid; /* Window id of text area */ | |
192 | int visibility; /* Is window partially/fully obscured? */ | |
193 | #endif | |
194 | --- 460,465 ---- | |
195 | *** ../vim-7.1.006/src/version.c Tue Jun 19 15:40:51 2007 | |
196 | --- src/version.c Tue Jun 19 15:44:15 2007 | |
197 | *************** | |
198 | *** 668,669 **** | |
199 | --- 668,671 ---- | |
200 | { /* Add new patch number below this line */ | |
201 | + /**/ | |
202 | + 7, | |
203 | /**/ | |
204 | ||
205 | -- | |
206 | When danger reared its ugly head, | |
207 | He bravely turned his tail and fled | |
208 | Yes, Brave Sir Robin turned about | |
209 | And gallantly he chickened out | |
210 | Bravely taking to his feet | |
211 | He beat a very brave retreat | |
212 | Bravest of the brave Sir Robin | |
213 | Petrified of being dead | |
214 | Soiled his pants then brave Sir Robin | |
215 | Turned away and fled. | |
216 | "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD | |
217 | ||
218 | /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ | |
219 | /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ | |
220 | \\\ download, build and distribute -- http://www.A-A-P.org /// | |
221 | \\\ help me help AIDS victims -- http://ICCF-Holland.org /// |