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/aura/window_tree_host_x11.h" | 5 #include "ui/aura/window_tree_host_x11.h" |
6 | 6 |
7 #include <strings.h> | 7 #include <strings.h> |
8 #include <X11/cursorfont.h> | 8 #include <X11/cursorfont.h> |
9 #include <X11/extensions/XInput2.h> | 9 #include <X11/extensions/XInput2.h> |
10 #include <X11/extensions/Xrandr.h> | 10 #include <X11/extensions/Xrandr.h> |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 DestroyCompositor(); | 313 DestroyCompositor(); |
314 DestroyDispatcher(); | 314 DestroyDispatcher(); |
315 XDestroyWindow(xdisplay_, xwindow_); | 315 XDestroyWindow(xdisplay_, xwindow_); |
316 } | 316 } |
317 | 317 |
318 bool WindowTreeHostX11::CanDispatchEvent(const ui::PlatformEvent& event) { | 318 bool WindowTreeHostX11::CanDispatchEvent(const ui::PlatformEvent& event) { |
319 ::Window target = FindEventTarget(event); | 319 ::Window target = FindEventTarget(event); |
320 return target == xwindow_ || target == x_root_window_; | 320 return target == xwindow_ || target == x_root_window_; |
321 } | 321 } |
322 | 322 |
323 uint32_t WindowTreeHostX11::DispatchEvent(const ui::PlatformEvent& event) { | 323 ui::PostDispatchAction WindowTreeHostX11::DispatchEvent( |
| 324 const ui::PlatformEvent& event) { |
324 XEvent* xev = event; | 325 XEvent* xev = event; |
325 if (FindEventTarget(xev) == x_root_window_) { | 326 if (FindEventTarget(xev) == x_root_window_) { |
326 if (xev->type == GenericEvent) | 327 if (xev->type == GenericEvent) |
327 DispatchXI2Event(xev); | 328 DispatchXI2Event(xev); |
328 return ui::POST_DISPATCH_NONE; | 329 return ui::POST_DISPATCH_NONE; |
329 } | 330 } |
330 | 331 |
331 if (xev->type == MotionNotify) { | 332 if (xev->type == MotionNotify) { |
332 // Discard all but the most recent motion event that targets the same | 333 // Discard all but the most recent motion event that targets the same |
333 // window with unchanged state. | 334 // window with unchanged state. |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 } | 728 } |
728 | 729 |
729 namespace test { | 730 namespace test { |
730 | 731 |
731 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { | 732 void SetUseOverrideRedirectWindowByDefault(bool override_redirect) { |
732 default_override_redirect = override_redirect; | 733 default_override_redirect = override_redirect; |
733 } | 734 } |
734 | 735 |
735 } // namespace test | 736 } // namespace test |
736 } // namespace aura | 737 } // namespace aura |
OLD | NEW |