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

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2434483003: Fix keyboard-activated context menus (Closed)
Patch Set: Created 4 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index aa8bcf0573b83f1d71afcfe1d39df6d2c34ccccb..a74f20d7561512c1945c2089a318da8b2c20875f 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -587,6 +587,14 @@ void AcceleratorController::SetImeControlDelegate(
bool AcceleratorController::ShouldCloseMenuAndRepostAccelerator(
const ui::Accelerator& accelerator) const {
+ // The context menu can be activated via Search+Shift+Volume up. When seeing
+ // any key up events involving these keys, don't ever close the menu as it was
+ // involved in opening the menu.
+ if (accelerator.type() == ui::ET_KEY_RELEASED &&
+ (accelerator.key_code() == ui::VKEY_LWIN || accelerator.IsShiftDown() ||
+ accelerator.key_code() == ui::VKEY_F10))
+ return false;
oshima 2016/10/21 18:10:42 Looks like this is caused by the TOGGLE_APP_LIST a
David Tseng 2016/10/21 20:29:25 Done. This appears to fix the issue; thanks for t
oshima 2016/10/24 18:53:04 This is because the menu runs nested message loop,
David Tseng 2016/10/24 19:03:56 The menu used to run a message loop: https://coder
+
auto itr = accelerators_.find(accelerator);
if (itr == accelerators_.end())
return false; // Menu shouldn't be closed for an invalid accelerator.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698