Index: ui/views/cocoa/native_widget_mac_nswindow.mm |
diff --git a/ui/views/cocoa/native_widget_mac_nswindow.mm b/ui/views/cocoa/native_widget_mac_nswindow.mm |
index 9a6fa2ef8f4cd543b28a267046a9659a5db65e21..3e68fc620a701a5a011613fe7d2c9995d9c09655 100644 |
--- a/ui/views/cocoa/native_widget_mac_nswindow.mm |
+++ b/ui/views/cocoa/native_widget_mac_nswindow.mm |
@@ -85,4 +85,26 @@ |
[[self viewsNSWindowDelegate] onWindowOrderChanged:nil]; |
} |
+// NSResponder implementation. |
+ |
+- (void)cursorUpdate:(NSEvent*)theEvent { |
+ // The cursor provided by the delegate should only be applied within the |
+ // content area. This is because we rely on the contentView to track the |
+ // mouse cursor and forward cursorUpdate: messages up the responder chain. |
+ // The cursorUpdate: isn't handled in BridgedContentView because views-style |
+ // SetCapture() conflicts with the way tracking events are processed for |
+ // the view during a drag. Since the NSWindow is still in the responder chain |
+ // overriding cursorUpdate: here handles both cases. |
+ if (!NSPointInRect([theEvent locationInWindow], [[self contentView] frame])) { |
+ [super cursorUpdate:theEvent]; |
+ return; |
+ } |
+ |
+ NSCursor* cursor = [[self viewsNSWindowDelegate] cursor]; |
+ if (cursor) |
+ [cursor set]; |
+ else |
+ [super cursorUpdate:theEvent]; |
+} |
+ |
@end |