summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvimboss <devnull@localhost>2007-12-03 21:21:03 +0000
committervimboss <devnull@localhost>2007-12-03 21:21:03 +0000
commitda8b8230e613d1c3d1b91106e4399d47579c9a09 (patch)
tree1b36989bde8c57390e621a4aee4861a444877b24
parentfaaec957df070ae2de08aa756bff2f1d5da1cb04 (diff)
downloadvim-da8b8230e613d1c3d1b91106e4399d47579c9a09.tar.gz
updated for version 7.1-168v7.1.168v7-1-168
-rw-r--r--src/gui_w48.c16
-rw-r--r--src/version.c2
2 files changed, 16 insertions, 2 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c
index 42cf91fd..b391a0dc 100644
--- a/src/gui_w48.c
+++ b/src/gui_w48.c
@@ -290,6 +290,11 @@ static struct
/* Local variables */
static int s_button_pending = -1;
+
+/* s_getting_focus is set when we got focus but didn't see mouse-up event yet,
+ * so don't reset s_button_pending. */
+static int s_getting_focus = FALSE;
+
static int s_x_pending;
static int s_y_pending;
static UINT s_kFlags_pending;
@@ -671,6 +676,8 @@ _OnMouseEvent(
{
int vim_modifiers = 0x0;
+ s_getting_focus = FALSE;
+
if (keyFlags & MK_SHIFT)
vim_modifiers |= MOUSE_SHIFT;
if (keyFlags & MK_CONTROL)
@@ -792,6 +799,7 @@ _OnMouseMoveOrRelease(
{
int button;
+ s_getting_focus = FALSE;
if (s_button_pending > -1)
{
/* Delayed action for mouse down event */
@@ -1951,8 +1959,10 @@ gui_mch_wait_for_chars(int wtime)
allow_scrollbar = FALSE;
/* Clear pending mouse button, the release event may have been
- * taken by the dialog window. */
- s_button_pending = -1;
+ * taken by the dialog window. But don't do this when getting
+ * focus, we need the mouse-up event then. */
+ if (!s_getting_focus)
+ s_button_pending = -1;
return OK;
}
@@ -2702,6 +2712,7 @@ _OnSetFocus(
HWND hwndOldFocus)
{
gui_focus_change(TRUE);
+ s_getting_focus = TRUE;
(void)MyWindowProc(hwnd, WM_SETFOCUS, (WPARAM)hwndOldFocus, 0);
}
@@ -2711,6 +2722,7 @@ _OnKillFocus(
HWND hwndNewFocus)
{
gui_focus_change(FALSE);
+ s_getting_focus = FALSE;
(void)MyWindowProc(hwnd, WM_KILLFOCUS, (WPARAM)hwndNewFocus, 0);
}
diff --git a/src/version.c b/src/version.c
index 975b4bb6..1ae453c3 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 168,
+/**/
167,
/**/
166,