OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" | 5 #include "ui/views/widget/desktop_aura/x11_whole_screen_move_loop.h" |
6 | 6 |
7 #include <X11/Xlib.h> | 7 #include <X11/Xlib.h> |
8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. | 8 // Get rid of a macro from Xlib.h that conflicts with Aura's RootWindow class. |
9 #undef RootWindow | 9 #undef RootWindow |
10 | 10 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source, | 104 bool X11WholeScreenMoveLoop::RunMoveLoop(aura::Window* source, |
105 gfx::NativeCursor cursor) { | 105 gfx::NativeCursor cursor) { |
106 // Start a capture on the host, so that it continues to receive events during | 106 // Start a capture on the host, so that it continues to receive events during |
107 // the drag. This may be second time we are capturing the mouse events - the | 107 // the drag. This may be second time we are capturing the mouse events - the |
108 // first being when a mouse is first pressed. That first capture needs to be | 108 // first being when a mouse is first pressed. That first capture needs to be |
109 // released before the call to GrabPointerAndKeyboard below, otherwise it may | 109 // released before the call to GrabPointerAndKeyboard below, otherwise it may |
110 // get released while we still need the pointer grab, which is why we restrict | 110 // get released while we still need the pointer grab, which is why we restrict |
111 // the scope here. | 111 // the scope here. |
112 { | 112 { |
113 ScopedCapturer capturer(source->GetDispatcher()->host()); | 113 ScopedCapturer capturer(source->GetHost()); |
114 | 114 |
115 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. | 115 DCHECK(!in_move_loop_); // Can only handle one nested loop at a time. |
116 in_move_loop_ = true; | 116 in_move_loop_ = true; |
117 | 117 |
118 XDisplay* display = gfx::GetXDisplay(); | 118 XDisplay* display = gfx::GetXDisplay(); |
119 | 119 |
120 grab_input_window_ = CreateDragInputWindow(display); | 120 grab_input_window_ = CreateDragInputWindow(display); |
121 if (!drag_image_.isNull() && CheckIfIconValid()) | 121 if (!drag_image_.isNull() && CheckIfIconValid()) |
122 CreateDragImageWindow(); | 122 CreateDragImageWindow(); |
123 base::MessagePumpX11::Current()->AddDispatcherForWindow( | 123 base::MessagePumpX11::Current()->AddDispatcherForWindow( |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 char value = SkColorGetA(in_row[x]) > kMinAlpha; | 300 char value = SkColorGetA(in_row[x]) > kMinAlpha; |
301 if (value) | 301 if (value) |
302 return true; | 302 return true; |
303 } | 303 } |
304 } | 304 } |
305 | 305 |
306 return false; | 306 return false; |
307 } | 307 } |
308 | 308 |
309 } // namespace views | 309 } // namespace views |
OLD | NEW |