| 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/keysym.h> | 7 #include <X11/keysym.h> |
| 8 #include <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 last_xmotion_.type = LASTEvent; | 59 last_xmotion_.type = LASTEvent; |
| 60 } | 60 } |
| 61 | 61 |
| 62 //////////////////////////////////////////////////////////////////////////////// | 62 //////////////////////////////////////////////////////////////////////////////// |
| 63 // DesktopWindowTreeHostLinux, ui::PlatformEventDispatcher implementation: | 63 // DesktopWindowTreeHostLinux, ui::PlatformEventDispatcher implementation: |
| 64 | 64 |
| 65 bool X11WholeScreenMoveLoop::CanDispatchEvent(const ui::PlatformEvent& event) { | 65 bool X11WholeScreenMoveLoop::CanDispatchEvent(const ui::PlatformEvent& event) { |
| 66 return in_move_loop_; | 66 return in_move_loop_; |
| 67 } | 67 } |
| 68 | 68 |
| 69 uint32_t X11WholeScreenMoveLoop::DispatchEvent(const ui::PlatformEvent& event) { | 69 ui::PostDispatchAction X11WholeScreenMoveLoop::DispatchEvent( |
| 70 const ui::PlatformEvent& event) { |
| 70 // This method processes all events while the move loop is active. | 71 // This method processes all events while the move loop is active. |
| 71 if (!in_move_loop_) | 72 if (!in_move_loop_) |
| 72 return ui::POST_DISPATCH_PERFORM_DEFAULT; | 73 return ui::POST_DISPATCH_PERFORM_DEFAULT; |
| 73 | 74 |
| 74 XEvent* xev = event; | 75 XEvent* xev = event; |
| 75 switch (xev->type) { | 76 switch (xev->type) { |
| 76 case MotionNotify: { | 77 case MotionNotify: { |
| 77 last_xmotion_ = xev->xmotion; | 78 last_xmotion_ = xev->xmotion; |
| 78 if (!weak_factory_.HasWeakPtrs()) { | 79 if (!weak_factory_.HasWeakPtrs()) { |
| 79 // Post a task to dispatch mouse movement event when control returns to | 80 // Post a task to dispatch mouse movement event when control returns to |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 DefaultRootWindow(display), | 298 DefaultRootWindow(display), |
| 298 -100, -100, 10, 10, | 299 -100, -100, 10, 10, |
| 299 0, CopyFromParent, InputOnly, CopyFromParent, | 300 0, CopyFromParent, InputOnly, CopyFromParent, |
| 300 attribute_mask, &swa); | 301 attribute_mask, &swa); |
| 301 XMapRaised(display, window); | 302 XMapRaised(display, window); |
| 302 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window); | 303 ui::X11EventSource::GetInstance()->BlockUntilWindowMapped(window); |
| 303 return window; | 304 return window; |
| 304 } | 305 } |
| 305 | 306 |
| 306 } // namespace views | 307 } // namespace views |
| OLD | NEW |