summaryrefslogtreecommitdiffstats
path: root/ash/shell_context_menu.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-18 16:19:13 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-18 16:19:13 +0000
commitc6d4bc432dfd552f842b5288e44514e4c23385b9 (patch)
treef2e33e7cc299ee0399d91ed6adcf3aecea81ab63 /ash/shell_context_menu.cc
parent2bddd20716a1216576e2c27ecbfa24ccf03e200b (diff)
downloadchromium_src-c6d4bc432dfd552f842b5288e44514e4c23385b9.zip
chromium_src-c6d4bc432dfd552f842b5288e44514e4c23385b9.tar.gz
chromium_src-c6d4bc432dfd552f842b5288e44514e4c23385b9.tar.bz2
Activate RootWindow when opening background ContextMenu
This causes the active root window != the root window of active window. I'm still vague about what this really means, but this was causing a menu widget being created on other display (which leads to crash) and I'd like to check this in to proceed. I'll add test once http://codereview.chromium.org/10536187/ is landed. BUG=123160 TEST=none Review URL: https://chromiumcodereview.appspot.com/10553013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142729 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell_context_menu.cc')
-rw-r--r--ash/shell_context_menu.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/ash/shell_context_menu.cc b/ash/shell_context_menu.cc
index 9487314..7973ca2 100644
--- a/ash/shell_context_menu.cc
+++ b/ash/shell_context_menu.cc
@@ -7,9 +7,11 @@
#include "ash/desktop_background/desktop_background_controller.h"
#include "ash/shell.h"
#include "grit/ash_strings.h"
+#include "ui/aura/window.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/menu/menu_model_adapter.h"
#include "ui/views/controls/menu/menu_runner.h"
+#include "ui/views/widget/widget.h"
namespace ash {
namespace internal {
@@ -22,6 +24,12 @@ ShellContextMenu::~ShellContextMenu() {
void ShellContextMenu::ShowMenu(views::Widget* widget,
const gfx::Point& location) {
+ // TODO(oshima): Figure out the exact semantics of
+ // just switching the active root window without changing the
+ // active window.
+ Shell::GetInstance()->set_active_root_window(
+ widget->GetNativeView()->GetRootWindow());
+
ui::SimpleMenuModel menu_model(this);
menu_model.AddItem(MENU_CHANGE_WALLPAPER,
l10n_util::GetStringUTF16(IDS_AURA_SET_DESKTOP_WALLPAPER));