From c66692f0a6ff52b2895af27094fcccb8925ff771 Mon Sep 17 00:00:00 2001 From: Bjorn Winckler Date: Mon, 27 Aug 2007 14:10:33 +0000 Subject: [PATCH] Mouse moved events not sent unless a window is key. git-svn-id: http://macvim.googlecode.com/svn/trunk@205 96c4425d-ca35-0410-94e5-3396d5c13a8f --- MMTextView.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/MMTextView.m b/MMTextView.m index 88ca43146a..4aae2bfe88 100644 --- a/MMTextView.m +++ b/MMTextView.m @@ -398,7 +398,12 @@ static float MMDragAreaSize = 73.0f; - (void)mouseEntered:(NSEvent *)event { //NSLog(@"%s", _cmd); - [[self window] setAcceptsMouseMovedEvents:YES]; + + // NOTE: This event is received even when the window is not key; thus we + // have to take care not to enable mouse moved events unless our window is + // key. + if ([[self window] isKeyWindow]) + [[self window] setAcceptsMouseMovedEvents:YES]; } - (void)mouseExited:(NSEvent *)event @@ -407,6 +412,9 @@ static float MMDragAreaSize = 73.0f; [[self window] setAcceptsMouseMovedEvents:NO]; + // NOTE: This event is received even when the window is not key; if the + // mouse shape is set when our window is not key, the hollow (unfocused) + // cursor will become a block (focused) cursor. if ([[self window] isKeyWindow]) { int shape = 0; NSMutableData *data = [NSMutableData data];