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

Unified Diff: chrome/browser/ui/cocoa/base_bubble_controller.mm

Issue 300113009: Fix BaseBubbleController close issue. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style fixing Created 6 years, 6 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 | chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/base_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/base_bubble_controller.mm b/chrome/browser/ui/cocoa/base_bubble_controller.mm
index 6dc573696ead2092213d8890b6db9d917a2d2f5f..2628f054b5f22ba95cef1810e560206f57918a5f 100644
--- a/chrome/browser/ui/cocoa/base_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/base_bubble_controller.mm
@@ -241,14 +241,16 @@
// The eventTap_ catches clicks within the application that are outside the
// window.
eventTap_ = [NSEvent
- addLocalMonitorForEventsMatchingMask:NSLeftMouseDownMask
+ addLocalMonitorForEventsMatchingMask:NSLeftMouseDownMask |
+ NSRightMouseDownMask
handler:^NSEvent* (NSEvent* event) {
if (event.window != window) {
- // Call via the runloop because this block is called in the
- // middle of event dispatch.
- [self performSelector:@selector(windowDidResignKey:)
- withObject:note
- afterDelay:0];
+ // Do it right now, because if this event is right mouse event,
+ // it may pop up a menu. windowDidResignKey: will not run until
+ // the menu is closed.
+ if ([self respondsToSelector:@selector(windowDidResignKey:)]) {
+ [self windowDidResignKey:note];
+ }
}
return event;
}];
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698