2 Subject: Patch 7.1.168 (extra)
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: Win32 GUI: Since patch 7.1.095, when the Vim window does not have
12 focus, clicking in it doesn't position the cursor. (Juergen
14 Solution: Don't reset s_button_pending just after receiving focus.
18 *** ../vim-7.1.167/src/gui_w48.c Tue Nov 20 17:21:28 2007
19 --- src/gui_w48.c Mon Dec 3 22:13:16 2007
25 static int s_button_pending = -1;
27 + /* s_getting_focus is set when we got focus but didn't see mouse-up event yet,
28 + * so don't reset s_button_pending. */
29 + static int s_getting_focus = FALSE;
31 static int s_x_pending;
32 static int s_y_pending;
33 static UINT s_kFlags_pending;
38 int vim_modifiers = 0x0;
40 + s_getting_focus = FALSE;
42 if (keyFlags & MK_SHIFT)
43 vim_modifiers |= MOUSE_SHIFT;
44 if (keyFlags & MK_CONTROL)
51 + s_getting_focus = FALSE;
52 if (s_button_pending > -1)
54 /* Delayed action for mouse down event */
57 allow_scrollbar = FALSE;
59 /* Clear pending mouse button, the release event may have been
60 ! * taken by the dialog window. */
61 ! s_button_pending = -1;
66 allow_scrollbar = FALSE;
68 /* Clear pending mouse button, the release event may have been
69 ! * taken by the dialog window. But don't do this when getting
70 ! * focus, we need the mouse-up event then. */
71 ! if (!s_getting_focus)
72 ! s_button_pending = -1;
81 gui_focus_change(TRUE);
82 + s_getting_focus = TRUE;
83 (void)MyWindowProc(hwnd, WM_SETFOCUS, (WPARAM)hwndOldFocus, 0);
91 gui_focus_change(FALSE);
92 + s_getting_focus = FALSE;
93 (void)MyWindowProc(hwnd, WM_KILLFOCUS, (WPARAM)hwndNewFocus, 0);
96 *** ../vim-7.1.167/src/version.c Mon Dec 3 21:31:56 2007
97 --- src/version.c Mon Dec 3 22:16:32 2007
101 { /* Add new patch number below this line */
107 Rule #1: Don't give somebody a tool that he's going to hurt himself with.
109 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
110 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
111 \\\ download, build and distribute -- http://www.A-A-P.org ///
112 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///