| Index: services/ui/public/interfaces/window_tree.mojom
|
| diff --git a/services/ui/public/interfaces/window_tree.mojom b/services/ui/public/interfaces/window_tree.mojom
|
| index 65416a8f11a6e8c3366d75dd359020292e505ba9..11adc9f771ab19dc960a9279bd7e0727744b5e92 100644
|
| --- a/services/ui/public/interfaces/window_tree.mojom
|
| +++ b/services/ui/public/interfaces/window_tree.mojom
|
| @@ -32,12 +32,12 @@ import "ui/platform_window/mojo/text_input_state.mojom";
|
| //
|
| // Event processing happens in the following order:
|
| // . The event is sent to the accelerator registered for the PRE_TARGET. If
|
| -// the client consumes the event, matching event observers are notified and
|
| +// the client consumes the event, matching pointer watchers are notified and
|
| // processing stops. If the client does not consume the event processing
|
| // continues.
|
| // . Target window (lookup of the target window depends upon the event type) and
|
| -// matching event observers are notified at the same time. The target is only
|
| -// notified once, even if it has a matching event observer registered. If the
|
| +// matching pointer watchers are notified at the same time. The target is only
|
| +// notified once, even if it has a matching pointer watcher registered. If the
|
| // target consumes the event, processing stops.
|
| // . Accelerator registered for POST_TARGET. No response is expected from the
|
| // client for the POST_TARGET and processing of the next continues
|
| @@ -80,15 +80,20 @@ interface WindowTree {
|
| // if |window_id| does not currently have capture.
|
| ReleaseCapture(uint32 change_id, uint32 window_id);
|
|
|
| - // Sets an observer that monitors all events, even if they are not targeted
|
| - // at a window in this tree. If an event matchs |matcher| the observer reports
|
| - // it to the WindowTreeClient via OnWindowInputEvent (if the event target is
|
| - // this window tree) or OnEventObserved (if the target is another tree). The
|
| + // Starts the pointer watcher that monitors all events (including move events
|
| + // if |want_moves| is true), even if they are not targeted at a window in this
|
| + // tree. If an event matches the pointer watcher the observer reports it to
|
| + // the WindowTreeClient via OnWindowInputEvent (if the event target is this
|
| + // window tree) or OnPointerWatcherEvent (if the target is another tree). The
|
| // client must supply a non-zero |observer_id|, which is reported back with
|
| - // observed events. Set the matcher to null to clear the observer.
|
| + // observed events. The client should prefer |want_moves| to be false, as
|
| + // there's a system-wide performance/battery penalty for listening to moves.
|
| //
|
| // See class description for details on event delivery.
|
| - SetEventObserver(EventMatcher? matcher, uint32 observer_id);
|
| + StartPointerWatcher(bool want_moves, uint32 observer_id);
|
| +
|
| + // Stops the pointer watcher for all events.
|
| + StopPointerWatcher();
|
|
|
| // Sets the specified bounds of the specified window.
|
| SetWindowBounds(uint32 change_id, uint32 window_id, gfx.mojom.Rect bounds);
|
| @@ -366,18 +371,18 @@ interface WindowTreeClient {
|
| // Invoked when an event is targeted at the specified window. The client must
|
| // call WindowTree::OnWindowInputEventAck() with the same |event_id| to notify
|
| // that the event has been processed, and with an EventResult value to notify
|
| - // if the event was consumed. |event_observer_id| is non-zero if the event
|
| - // also matched the active event observer for this client. The client will not
|
| - // receive farther events until the event is ack'ed.
|
| + // if the event was consumed. |pointer_watcher_id| is non-zero if the event
|
| + // also matched the active pointer watcher for this client. The client will
|
| + // not receive farther events until the event is ack'ed.
|
| OnWindowInputEvent(uint32 event_id,
|
| uint32 window,
|
| ui.mojom.Event event,
|
| - uint32 event_observer_id);
|
| + uint32 pointer_watcher_id);
|
|
|
| - // Invoked when an |event| is sent via the EventObserver and not targeted at a
|
| - // specific window. The |event_observer_id| is the one supplied to
|
| - // SetEventObserver. The client should not acknowledge these events.
|
| - OnEventObserved(ui.mojom.Event event, uint32 event_observer_id);
|
| + // Invoked when an |event| is sent via the PointerWatcher and not targeted at
|
| + // a specific window. The |pointer_watcher_id| is the one supplied to
|
| + // StartPointerWatcher. The client should not acknowledge these events.
|
| + OnPointerWatcherEvent(ui.mojom.Event event, uint32 pointer_watcher_id);
|
|
|
| // Called in two distinct cases: when a window known to the connection gains
|
| // focus, or when focus moves from a window known to the connection to a
|
|
|