Index: ash/wm/partial_screenshot_view.cc |
diff --git a/ash/wm/partial_screenshot_view.cc b/ash/wm/partial_screenshot_view.cc |
index 23bdda448a46e4a2bd75dcafa3ecb78bc68b7bdc..0fa4f8ea85d9061a82ea353443bbe0a282804a0a 100644 |
--- a/ash/wm/partial_screenshot_view.cc |
+++ b/ash/wm/partial_screenshot_view.cc |
@@ -10,6 +10,7 @@ |
#include "ash/wm/partial_screenshot_event_filter.h" |
#include "ui/aura/root_window.h" |
#include "ui/aura/window.h" |
+#include "ui/base/events.h" |
#include "ui/base/cursor/cursor.h" |
#include "ui/gfx/canvas.h" |
#include "ui/gfx/rect.h" |
@@ -56,6 +57,11 @@ void PartialScreenshotView::StartPartialScreenshot( |
widget->GetNativeView()->SetName("PartialScreenshotView"); |
widget->StackAtTop(); |
widget->Show(); |
+ // Captures mouse events in case that context menu already captures the |
+ // events. This will close the context menu. |
+ // TODO(mukai): introduce stacking mechanism to capture window to |
sky
2012/04/12 15:30:45
To have menus stay on screen in this scenario will
Jun Mukai
2012/04/13 06:11:28
Then, removed the TODO.
|
+ // prevent closing menus. |
+ widget->GetNativeView()->SetCapture(ui::CW_LOCK_MOUSE | ui::CW_LOCK_TOUCH); |
view->set_window(widget->GetNativeWindow()); |
Shell::GetInstance()->partial_screenshot_filter()->Activate(view); |
@@ -85,6 +91,10 @@ void PartialScreenshotView::OnPaint(gfx::Canvas* canvas) { |
} |
} |
+void PartialScreenshotView::OnMouseCaptureLost() { |
+ Cancel(); |
+} |
+ |
bool PartialScreenshotView::OnMousePressed(const views::MouseEvent& event) { |
start_position_ = event.location(); |
return true; |