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
This commit is contained in:
Bjorn Winckler
2007-08-27 14:10:33 +00:00
parent a5bc4a7311
commit c66692f0a6
+9 -1
View File
@@ -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];