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

Issue 2450903002: MacViews: Clear mouse handler when showing context menus. (Closed)

Created:
4 years, 1 month ago by themblsha
Modified:
4 years, 1 month ago
Reviewers:
tapted, sadrul, sky
CC:
chromium-reviews, tfarina
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Clear mouse handler when showing context menus. Currently the View that invokes a menu may incorrectly retain capture and swallow subsequent mouse events. To fix we explicitly clear mouse handler when showing context menus. This same issue was previously fixed individually within ToolbarButton (r15) and Combobox (r83617) before the common fix inside MenuController (r192688). On MacViews the MenuController is not used, and we have the MenuRunnerImplCocoa which didn't contain the fix for this issue. Move the fix to the common place that's shared between all the implementations of MenuRunnerImplInterface. BUG=659204 TEST=Open Chromium, open two tabs with non-empty URLs; Close the second tab; Right-click the first tab and select Reopen Closed Tab; Click on the second tab. Second tab should activate. See crbug.com/659204 for video. Committed: https://crrev.com/c329b603044633b6ff0b2f17b2dfc5a1f1200ffa Cr-Commit-Position: refs/heads/master@{#429673}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Moved fix to MenuRunner::RunMenuAt, remove redundant fixes. #

Total comments: 2

Patch Set 3 : Added test. #

Total comments: 10

Patch Set 4 : Removed duplicate code in test. #

Total comments: 4

Patch Set 5 : Fix review issues. #

Patch Set 6 : Fix test on Windows. #

Patch Set 7 : Fix test on both Mac and Windows. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -40 lines) Patch
M chrome/browser/ui/views/toolbar/toolbar_button.cc View 1 1 chunk +0 lines, -5 lines 0 comments Download
M ui/views/controls/combobox/combobox.cc View 1 2 3 1 chunk +0 lines, -5 lines 0 comments Download
M ui/views/controls/menu/menu_controller.cc View 1 2 3 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/controls/menu/menu_runner.cc View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M ui/views/controls/menu/menu_runner_unittest.cc View 1 2 3 4 5 6 1 chunk +96 lines, -26 lines 0 comments Download

Messages

Total messages: 36 (18 generated)
themblsha
I've provided the reproduction steps + video: https://bugs.chromium.org/p/chromium/issues/detail?id=659204
4 years, 1 month ago (2016-10-25 17:36:06 UTC) #3
tapted
+sky for his menu-code superpowers - but there are lots of callsites doing SetMouseHandler(nullptr) (e.g. ...
4 years, 1 month ago (2016-10-26 02:15:31 UTC) #5
themblsha
Updated Issue Description, hope it's better now. I wonder what's the best place to write ...
4 years, 1 month ago (2016-10-26 15:49:14 UTC) #8
sky
https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc File ui/views/controls/menu/menu_runner.cc (right): https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc#newcode63 ui/views/controls/menu/menu_runner.cc:63: if (parent && parent->GetRootView()) Can you clarify why you ...
4 years, 1 month ago (2016-10-26 17:46:11 UTC) #9
themblsha
https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc File ui/views/controls/menu/menu_runner.cc (right): https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc#newcode63 ui/views/controls/menu/menu_runner.cc:63: if (parent && parent->GetRootView()) On 2016/10/26 17:46:11, sky wrote: ...
4 years, 1 month ago (2016-10-27 15:05:29 UTC) #10
sky
On 2016/10/27 15:05:29, themblsha wrote: > https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc > File ui/views/controls/menu/menu_runner.cc (right): > > https://codereview.chromium.org/2450903002/diff/20001/ui/views/controls/menu/menu_runner.cc#newcode63 > ...
4 years, 1 month ago (2016-10-27 16:08:50 UTC) #11
tapted
https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc File ui/views/controls/menu/menu_runner.cc (right): https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc#newcode66 ui/views/controls/menu/menu_runner.cc:66: return impl_->RunMenuAt(parent, button, bounds, anchor, run_types_); (answering for themblsha ...
4 years, 1 month ago (2016-10-27 23:19:24 UTC) #12
sky
On 2016/10/27 23:19:24, tapted wrote: > https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc > File ui/views/controls/menu/menu_runner.cc (right): > > https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc#newcode66 > ...
4 years, 1 month ago (2016-10-27 23:36:45 UTC) #13
themblsha
https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc File ui/views/controls/menu/menu_runner.cc (right): https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc#newcode66 ui/views/controls/menu/menu_runner.cc:66: return impl_->RunMenuAt(parent, button, bounds, anchor, run_types_); On 2016/10/27 23:19:24, ...
4 years, 1 month ago (2016-10-29 13:47:19 UTC) #16
tapted
lgtm % nits On 2016/10/29 13:47:19, themblsha wrote: > https://codereview.chromium.org/2450903002/diff/40001/ui/views/controls/menu/menu_runner.cc > File ui/views/controls/menu/menu_runner.cc (right): > ...
4 years, 1 month ago (2016-10-30 23:25:53 UTC) #17
themblsha
Ah, I thought that TEST could be machine-readable. Thanks for clarification! https://codereview.chromium.org/2450903002/diff/60001/ui/views/controls/menu/menu_runner_unittest.cc File ui/views/controls/menu/menu_runner_unittest.cc (right): ...
4 years, 1 month ago (2016-10-31 12:19:23 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2450903002/80001
4 years, 1 month ago (2016-10-31 12:19:43 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/307879)
4 years, 1 month ago (2016-10-31 12:53:08 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2450903002/100001
4 years, 1 month ago (2016-11-03 15:25:41 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/330181)
4 years, 1 month ago (2016-11-03 16:02:42 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2450903002/120001
4 years, 1 month ago (2016-11-03 17:29:35 UTC) #32
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 1 month ago (2016-11-03 19:40:05 UTC) #34
commit-bot: I haz the power
4 years, 1 month ago (2016-11-03 19:47:02 UTC) #36
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/c329b603044633b6ff0b2f17b2dfc5a1f1200ffa
Cr-Commit-Position: refs/heads/master@{#429673}

Powered by Google App Engine
This is Rietveld 408576698