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 <stddef.h> | 7 #include <stddef.h> |
8 #include <X11/keysym.h> | 8 #include <X11/keysym.h> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 #include <utility> | 10 #include <utility> |
(...skipping 30 matching lines...) Expand all Loading... |
41 Mod5Mask, // Scroll lock | 41 Mod5Mask, // Scroll lock |
42 Mod2Mask | LockMask, | 42 Mod2Mask | LockMask, |
43 Mod2Mask | Mod5Mask, | 43 Mod2Mask | Mod5Mask, |
44 LockMask | Mod5Mask, | 44 LockMask | Mod5Mask, |
45 Mod2Mask | LockMask | Mod5Mask | 45 Mod2Mask | LockMask | Mod5Mask |
46 }; | 46 }; |
47 | 47 |
48 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate) | 48 X11WholeScreenMoveLoop::X11WholeScreenMoveLoop(X11MoveLoopDelegate* delegate) |
49 : delegate_(delegate), | 49 : delegate_(delegate), |
50 in_move_loop_(false), | 50 in_move_loop_(false), |
51 initial_cursor_(ui::kCursorNull), | 51 initial_cursor_(ui::CursorType::kNull), |
52 should_reset_mouse_flags_(false), | 52 should_reset_mouse_flags_(false), |
53 grab_input_window_(None), | 53 grab_input_window_(None), |
54 grabbed_pointer_(false), | 54 grabbed_pointer_(false), |
55 canceled_(false), | 55 canceled_(false), |
56 weak_factory_(this) { | 56 weak_factory_(this) {} |
57 } | |
58 | 57 |
59 X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {} | 58 X11WholeScreenMoveLoop::~X11WholeScreenMoveLoop() {} |
60 | 59 |
61 void X11WholeScreenMoveLoop::DispatchMouseMovement() { | 60 void X11WholeScreenMoveLoop::DispatchMouseMovement() { |
62 if (!last_motion_in_screen_) | 61 if (!last_motion_in_screen_) |
63 return; | 62 return; |
64 delegate_->OnMouseMovement(last_motion_in_screen_->location(), | 63 delegate_->OnMouseMovement(last_motion_in_screen_->location(), |
65 last_motion_in_screen_->flags(), | 64 last_motion_in_screen_->flags(), |
66 last_motion_in_screen_->time_stamp()); | 65 last_motion_in_screen_->time_stamp()); |
67 last_motion_in_screen_.reset(); | 66 last_motion_in_screen_.reset(); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 PointerMotionMask | KeyPressMask | KeyReleaseMask | | 275 PointerMotionMask | KeyPressMask | KeyReleaseMask | |
277 StructureNotifyMask; | 276 StructureNotifyMask; |
278 grab_input_window_events_.reset( | 277 grab_input_window_events_.reset( |
279 new ui::XScopedEventSelector(grab_input_window_, event_mask)); | 278 new ui::XScopedEventSelector(grab_input_window_, event_mask)); |
280 | 279 |
281 XMapRaised(display, grab_input_window_); | 280 XMapRaised(display, grab_input_window_); |
282 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(grab_input_window_); | 281 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(grab_input_window_); |
283 } | 282 } |
284 | 283 |
285 } // namespace views | 284 } // namespace views |
OLD | NEW |