Index: ui/views/cocoa/bridged_native_widget.mm |
diff --git a/ui/views/cocoa/bridged_native_widget.mm b/ui/views/cocoa/bridged_native_widget.mm |
index 4062f9a2608908700384ada4a7dd91cabd089532..96d0170b7b5f2c5d8376ce76a6661a2ecdfbcbe8 100644 |
--- a/ui/views/cocoa/bridged_native_widget.mm |
+++ b/ui/views/cocoa/bridged_native_widget.mm |
@@ -204,6 +204,14 @@ void BridgedNativeWidget::AcquireCapture() { |
return; // Capture on hidden windows is disallowed. |
mouse_capture_.reset(new CocoaMouseCapture(this)); |
+ |
+ // Initiating global event capture with addGlobalMonitorForEventsMatchingMask: |
+ // will reset the mouse cursor to an arrow. Asking the window for an update |
+ // here will restore what we want. However, it can sometimes cause the cursor |
+ // to flicker, once, on the initial mouseDown. |
+ // TOOD(tapted): Make this unnecessary by only asking for global mouse capture |
+ // for the cases that need it (e.g. menus, but not drag and drop). |
+ [window_ cursorUpdate:[NSApp currentEvent]]; |
} |
void BridgedNativeWidget::ReleaseCapture() { |
@@ -230,6 +238,10 @@ void* BridgedNativeWidget::GetNativeWindowProperty(const char* name) const { |
return [[GetWindowProperties() objectForKey:key] pointerValue]; |
} |
+void BridgedNativeWidget::SetCursor(NSCursor* cursor) { |
+ [window_delegate_ setCursor:cursor]; |
+} |
+ |
void BridgedNativeWidget::OnWindowWillClose() { |
if (parent_) |
parent_->RemoveChildWindow(this); |