New issue
Advanced search Search tips

Issue 605580 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

mus: EventObservers should only send event once to target window

Project Member Reported by jamescook@chromium.org, Apr 21 2016

Issue description

This assumes https://codereview.chromium.org/1909733002 lands, implementing EventObservers.

Assume a client app that has an EventObserver, say to watch for pointer-down events anywhere on the display.

Right now, a pointer-down event that hits a window belonging to that client will be sent to it twice, once via OnEventObserver() (triggering the client's observer code) and once via the usual OnInputEvent(). In most cases this is easy on the client, as the client's observer code can't do normal dispatch actions -- observers can't mark events as handled, so any observer code has to be independent of normal dispatch.

As an optimization it would be better to send such events to the client once, via OnInputEvent(), with a flag that says it also matches an EventObserver. Then the client library could trigger both normal dispatch and observers.

This is a little tricky because events are not guaranteed to have a target, and mus::ws::EventDispatcher can drop events in multiple locations, so we'll need to return information about whether the event actually found a target, and which WindowTree contains that target, and then decide whether to send the event via OnInputEvent() vs. OnEventObserved().

 
Status: Fixed (was: Assigned)
This actually got implemented as part of the initial commit.

Components: -MUS Internals>Services>WindowService

Sign in to add a comment