Index: ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc |
diff --git a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc |
index 966a791862c327e371e8971162ffeef169bf65fd..2633401e267c0a68af20f009fb5b576df13298ef 100644 |
--- a/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc |
+++ b/ui/views/widget/desktop_aura/x11_whole_screen_move_loop.cc |
@@ -93,21 +93,25 @@ bool X11WholeScreenMoveLoop::Dispatch(const base::NativeEvent& event) { |
bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source, |
gfx::NativeCursor cursor) { |
- // Start a capture on the host, so that it continues to receive events during |
- // the drag. |
- ScopedCapturer capturer(source->GetDispatcher()->host()); |
- |
- DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
- in_move_loop_ = true; |
- |
- XDisplay* display = gfx::GetXDisplay(); |
- |
- grab_input_window_ = CreateDragInputWindow(display); |
- if (!drag_image_.isNull()) |
- CreateDragImageWindow(); |
- base::MessagePumpX11::Current()->AddDispatcherForWindow( |
- this, grab_input_window_); |
- |
+ { |
+ // A capture is started on the host, so that it continues to receive events |
+ // during the drag. |
+ ScopedCapturer capturer(source->GetDispatcher()->host()); |
+ |
+ DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
+ in_move_loop_ = true; |
+ |
+ XDisplay* display = gfx::GetXDisplay(); |
+ |
+ grab_input_window_ = CreateDragInputWindow(display); |
+ if (!drag_image_.isNull()) |
+ CreateDragImageWindow(); |
+ base::MessagePumpX11::Current()->AddDispatcherForWindow( |
+ this, grab_input_window_); |
+ // Releasing ScopedCapturer ensures that any other instance of |
+ // X11ScopedCapture will not prematurely release grab that will be acquired |
+ // below. |
sadrul
2014/02/06 19:14:46
I do not understand what this means. Mind explaini
varkha
2014/02/06 19:22:55
There are three points where we set capture, all t
sadrul
2014/02/07 00:08:37
In the context of a drag, who calls this first Set
|
+ } |
if (!GrabPointerWithCursor(cursor)) |
return false; |