Skip to content

Commit

Permalink
Merge pull request #7962 from liusy182/disable-accelerator
Browse files Browse the repository at this point in the history
disable accelerator when menu item is disabled
  • Loading branch information
kevinsawicki committed Nov 15, 2016
2 parents 89feefa + 9e91f31 commit 301b8ec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions atom/browser/ui/accelerator_util.cc
Expand Up @@ -90,11 +90,12 @@ bool TriggerAcceleratorTableCommand(AcceleratorTable* table,
const ui::Accelerator& accelerator) {
if (ContainsKey(*table, accelerator)) {
const accelerator_util::MenuItem& item = (*table)[accelerator];
item.model->ActivatedAt(item.position);
return true;
} else {
return false;
if (item.model->IsEnabledAt(item.position)) {
item.model->ActivatedAt(item.position);
return true;
}
}
return false;
}

} // namespace accelerator_util

0 comments on commit 301b8ec

Please sign in to comment.