[go: nahoru, domu]

x11: Migrate PlatformEvent to ui::Event in Aura/X11

This is the main part of the patch series migrating PlatformEvent to
ui::Event in Aura/X11. Design doc [1] describes in details such effort.

In this CL, Aura/X11 code which deals with ui::PlatformEvent is factored
to deal with ui::Event instead, which is currently a fundamental
difference between Aura/X11 and Ozone/X11. To accomplish it, this patch
does:

1. Refactor X11 PlatformWindow impl's dispatching logic to handle both
ui::Event (auto translated from XEvent and routed through
PlatformEventDispatcher API) and raw XEvents (X-specific events routed
through XEventDispatcher API). This makes it more similar to
X11WindowOzone, which also made it possible to;

2. Cleanup ui::XWindow code guarded by USE_X11, which consisted of
key/mouse/touch/scroll events handling, which is now handled at
X11EventSource level, i.e: XEvents are translated and routed through
{X,Platform}EventDispatcher infra.

3. Convert former PlatformEventDispatcher impls which deals with
X11-specific events into ui::XEventDispatchers;

4. Refactor some testing support code to make it work with this new
event flow scheme (i.e: X11-specific events routed through
XEventDispatcher instead of PlatformEventDispatcher, etc).

Even though this touches many files, the delta for each file is usually
small and trivial (e.g: PlatformEventDispatcher => XEventDispatcher).
The core changes are in X11Window and in some testing code. This should
not cause behavioral changes, but a single browser/interactive test
became flaky and was disabled for now (actually most tests from that
test suite are flaky and conditionally disabled for ozone configs, what
possibly points out to issues in the event processing pipeline when
ui::Event are used), the proposal for this is to further investigate and
address it in a separate CL.

[1] https://docs.google.com/document/d/1Neh2p6f8pew9SPuEAtnJMafozAY7uhAIfhwd43CLETc

Bug: 965991
Change-Id: I10539b8f94a5f0d4857735087ddaf5efd73f9b31
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022280
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Thomas Anderson <thomasanderson@chromium.org>
Commit-Queue: Nick Yamane <nickdiego@igalia.com>
Cr-Commit-Position: refs/heads/master@{#738353}
66 files changed