summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-16 01:36:33 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-16 01:36:33 +0000
commit6de4ea211e300e137cfec2176a1a012e5ec27e3e (patch)
tree3c0ec782a4ced342430fb45b57533534397a821c /chrome
parent2a39d61f95c032c9802da6a7eb6f977c8002568d (diff)
downloadchromium_src-6de4ea211e300e137cfec2176a1a012e5ec27e3e.zip
chromium_src-6de4ea211e300e137cfec2176a1a012e5ec27e3e.tar.gz
chromium_src-6de4ea211e300e137cfec2176a1a012e5ec27e3e.tar.bz2
[Mac] Properly fix cursor restore after closing context menu.
My previous change (http://crrev.com/92370) missed the case where the previous cursor sent by the renderer is the same as the one that should be displayed after the context menu is closed. This case is special because the renderer will not re-send the cursor if there was no change. To handle it, first restore to the previous cursor before sending a mouse move event to the renderer. BUG=64436 TEST=manual Review URL: http://codereview.chromium.org/7400004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92775 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/renderer_host/render_widget_host_view_mac.mm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 19362ee..7b66497 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -658,6 +658,11 @@ void RenderWidgetHostViewMac::ShowingContextMenu(bool showing) {
DCHECK_NE(is_showing_context_menu_, showing);
is_showing_context_menu_ = showing;
+ // If the menu was closed, restore the cursor to the saved version initially,
+ // as the renderer will not re-send it if there was no change.
+ if (!showing)
+ UpdateCursorIfNecessary();
+
// Create a fake mouse event to inform the render widget that the mouse
// left or entered.
NSWindow* window = [cocoa_view_ window];