Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Side by Side Diff: ui/aura/window_tree_host_x11.cc

Issue 667823002: PlatformEventDispatcher::DispatchEvent() should return a PostDispatchAction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ui_enums
Patch Set: Fix platform_event_source_unittest.cc Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/aura/window_tree_host_x11.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/aura/window_tree_host_x11.h ('k') | ui/base/clipboard/clipboard_aurax11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698