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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 private: | 50 private: |
51 aura::WindowTreeHost* host_; | 51 aura::WindowTreeHost* host_; |
52 | 52 |
53 DISALLOW_COPY_AND_ASSIGN(ScopedCapturer); | 53 DISALLOW_COPY_AND_ASSIGN(ScopedCapturer); |
54 }; | 54 }; |
55 | 55 |
56 } // namespace | 56 } // namespace |
57 | 57 |
58 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate) | 58 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop( |
| 59 X11WholeScreenMoveLoopDelegate* delegate) |
59 : delegate_(delegate), | 60 : delegate_(delegate), |
60 in_move_loop_(false), | 61 in_move_loop_(false), |
61 should_reset_mouse_flags_(false), | 62 should_reset_mouse_flags_(false), |
62 grab_input_window_(None), | 63 grab_input_window_(None), |
63 canceled_(false), | 64 canceled_(false), |
64 has_grab_(false), | 65 has_grab_(false), |
65 weak_factory_(this) { | 66 weak_factory_(this) { |
66 last_xmotion_.type = LASTEvent; | 67 last_xmotion_.type = LASTEvent; |
67 } | 68 } |
68 | 69 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 drag_widget_.reset(); | 270 drag_widget_.reset(); |
270 delegate_->OnMoveLoopEnded(); | 271 delegate_->OnMoveLoopEnded(); |
271 XDestroyWindow(display, grab_input_window_); | 272 XDestroyWindow(display, grab_input_window_); |
272 grab_input_window_ = None; | 273 grab_input_window_ = None; |
273 | 274 |
274 in_move_loop_ = false; | 275 in_move_loop_ = false; |
275 quit_closure_.Run(); | 276 quit_closure_.Run(); |
276 } | 277 } |
277 | 278 |
278 void X11WholeScreenMoveLoop::SetDragImage(const gfx::ImageSkia& image, | 279 void X11WholeScreenMoveLoop::SetDragImage(const gfx::ImageSkia& image, |
279 const gfx::Vector2dF& offset) { | 280 gfx::Vector2dF offset) { |
280 drag_image_ = image; | 281 drag_image_ = image; |
281 drag_offset_ = offset; | 282 drag_offset_ = offset; |
282 } | 283 } |
283 | 284 |
284 bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) { | 285 bool X11WholeScreenMoveLoop::GrabPointerAndKeyboard(gfx::NativeCursor cursor) { |
285 XDisplay* display = gfx::GetXDisplay(); | 286 XDisplay* display = gfx::GetXDisplay(); |
286 XGrabServer(display); | 287 XGrabServer(display); |
287 | 288 |
288 XUngrabPointer(display, CurrentTime); | 289 XUngrabPointer(display, CurrentTime); |
289 int ret = XGrabPointer( | 290 int ret = XGrabPointer( |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 for (int x = 0; x < in_bitmap->width(); ++x) { | 381 for (int x = 0; x < in_bitmap->width(); ++x) { |
381 if (SkColorGetA(in_row[x]) > kMinAlpha) | 382 if (SkColorGetA(in_row[x]) > kMinAlpha) |
382 return true; | 383 return true; |
383 } | 384 } |
384 } | 385 } |
385 | 386 |
386 return false; | 387 return false; |
387 } | 388 } |
388 | 389 |
389 } // namespace views | 390 } // namespace views |
OLD | NEW |