Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: ui/base/cocoa/base_view.mm

Issue 2337233004: MacViews: Fix sending mouse exit event and releasing capture on D&D. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/base/cocoa/base_view.mm
diff --git a/ui/base/cocoa/base_view.mm b/ui/base/cocoa/base_view.mm
index 47ccca96ad6dd866b986183dbbec4db376f85be6..1fbd5adf517bac3dc3bee68cda18d782ac32a3d1 100644
--- a/ui/base/cocoa/base_view.mm
+++ b/ui/base/cocoa/base_view.mm
@@ -83,7 +83,6 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection";
}
- (void)mouseDown:(NSEvent*)theEvent {
- dragging_ = YES;
[self mouseEvent:theEvent];
}
@@ -97,22 +96,6 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection";
- (void)mouseUp:(NSEvent*)theEvent {
[self mouseEvent:theEvent];
-
- dragging_ = NO;
- if (pendingExitEvent_.get()) {
- NSEvent* exitEvent =
- [NSEvent enterExitEventWithType:NSMouseExited
- location:[theEvent locationInWindow]
- modifierFlags:[theEvent modifierFlags]
- timestamp:[theEvent timestamp]
- windowNumber:[theEvent windowNumber]
- context:[theEvent context]
- eventNumber:[pendingExitEvent_.get() eventNumber]
- trackingNumber:[pendingExitEvent_.get() trackingNumber]
- userData:[pendingExitEvent_.get() userData]];
- [self mouseEvent:exitEvent];
- pendingExitEvent_.reset();
- }
}
- (void)rightMouseUp:(NSEvent*)theEvent {
@@ -140,23 +123,10 @@ NSString* kSelectionDirection = @"Chromium.kSelectionDirection";
}
- (void)mouseEntered:(NSEvent*)theEvent {
- if (pendingExitEvent_.get()) {
- pendingExitEvent_.reset();
- return;
- }
-
[self mouseEvent:theEvent];
}
- (void)mouseExited:(NSEvent*)theEvent {
- // The tracking area will send an exit event even during a drag, which isn't
- // how the event flow for drags should work. This stores the exit event, and
- // sends it when the drag completes instead.
- if (dragging_) {
- pendingExitEvent_.reset([theEvent retain]);
- return;
- }
-
[self mouseEvent:theEvent];
}

Powered by Google App Engine
This is Rietveld 408576698