summaryrefslogtreecommitdiffstats
path: root/views/widget/widget.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/widget.cc')
-rw-r--r--views/widget/widget.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index bfead84..2ab6bd71 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -10,6 +10,7 @@
#include "ui/base/l10n/l10n_font_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/compositor/compositor.h"
+#include "views/controls/menu/menu_controller.h"
#include "views/focus/view_storage.h"
#include "views/ime/input_method.h"
#include "views/views_delegate.h"
@@ -786,9 +787,15 @@ void Widget::EnableInactiveRendering() {
}
void Widget::OnNativeWidgetActivationChanged(bool active) {
- if (!active)
+ if (!active) {
SaveWindowPosition();
+ // Close any open menus.
+ MenuController* menu_controller = MenuController::GetActiveInstance();
+ if (menu_controller)
+ menu_controller->OnWidgetActivationChanged();
+ }
+
FOR_EACH_OBSERVER(Observer, observers_,
OnWidgetActivationChanged(this, active));
}