Commit a6ee75d9 authored by Federico Paredes's avatar Federico Paredes Committed by Commit Bot

Menus are no longer destroyed on Mac when focus is restored from another app.

R=avi

Bug: 1016011
Change-Id: I609c2958e52d837e1f43b0fd7497ba2013314086
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872561Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Federico Paredes <fedpar@microsoft.com>
Cr-Commit-Position: refs/heads/master@{#707974}
parent 8d8984c0
...@@ -33,7 +33,13 @@ MenuCocoaWatcherMac::MenuCocoaWatcherMac(base::OnceClosure callback) ...@@ -33,7 +33,13 @@ MenuCocoaWatcherMac::MenuCocoaWatcherMac(base::OnceClosure callback)
object:nil object:nil
queue:nil queue:nil
usingBlock:^(NSNotification* notification) { usingBlock:^(NSNotification* notification) {
ExecuteCallback(); // Only destroy menus if the browser is losing focus, not if
// it's gaining focus. This is to ensure that we can invoke
// a context menu while focused on another app, and still be
// able to click on menu items without dismissing the menu.
if (![[NSRunningApplication currentApplication] isActive]) {
ExecuteCallback();
}
}]; }];
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment