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

Issue 2696873002: Change OnWindowInputEvent to use display_id to find the host and update event root_location in WS. (Closed)

Created:
3 years, 10 months ago by riajiang
Modified:
3 years, 8 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews, kalyank, rjkroege, kylechar
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Change WindowTreeClient::OnWindowInputEvent() to always use display_id to find the host and use root window when window cannot be found. Update event root_location in window server to be from the coordinate system of the WmRoot to the coordinate system of the top-level window of the window tree that we are going to send that event to. This might happen if the window has already been deleted by the time WindowTreeClient::OnWindowInputEvent() is called. BUG=664617 TEST=aura_unittests mus_ws_unittests

Patch Set 1 #

Patch Set 2 : helper function #

Total comments: 2

Patch Set 3 : host #

Total comments: 2

Patch Set 4 : root location #

Total comments: 4

Patch Set 5 : sequence #

Total comments: 2

Patch Set 6 : convert root_location in ws #

Patch Set 7 : root window #

Total comments: 2

Patch Set 8 : TODO #

Total comments: 14

Patch Set 9 : sadrul@ comments #

Total comments: 8

Patch Set 10 : nits #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+242 lines, -49 lines) Patch
M services/ui/ws/test_change_tracker.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M services/ui/ws/test_change_tracker.cc View 1 2 3 4 5 6 7 8 2 chunks +7 lines, -0 lines 0 comments Download
M services/ui/ws/window_manager_state.cc View 1 2 3 4 5 6 7 8 3 chunks +22 lines, -2 lines 0 comments Download
M services/ui/ws/window_manager_state_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +24 lines, -1 line 0 comments Download
M services/ui/ws/window_tree.h View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -0 lines 0 comments Download
M services/ui/ws/window_tree.cc View 1 2 3 4 5 6 7 8 1 chunk +8 lines, -0 lines 1 comment Download
M services/ui/ws/window_tree_unittest.cc View 1 2 3 4 5 6 7 8 5 chunks +8 lines, -6 lines 0 comments Download
M ui/aura/mus/window_tree_client.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M ui/aura/mus/window_tree_client.cc View 1 2 3 4 5 6 7 8 9 5 chunks +57 lines, -34 lines 0 comments Download
M ui/aura/mus/window_tree_client_unittest.cc View 1 2 3 4 5 6 6 chunks +109 lines, -6 lines 0 comments Download

Messages

Total messages: 41 (13 generated)
riajiang
Hi sadrul@ and sky@, PTAL, thanks!
3 years, 10 months ago (2017-02-14 21:32:52 UTC) #4
sky
https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc#newcode1159 ui/aura/mus/window_tree_client.cc:1159: host = GetWindowTreeHostMus(window); I don't think you're guaranteed the ...
3 years, 10 months ago (2017-02-14 23:31:15 UTC) #5
sky
On 2017/02/14 23:31:15, sky wrote: > https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc > File ui/aura/mus/window_tree_client.cc (right): > > https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc#newcode1159 > ...
3 years, 10 months ago (2017-02-14 23:36:35 UTC) #6
riajiang
https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/40001/ui/aura/mus/window_tree_client.cc#newcode1159 ui/aura/mus/window_tree_client.cc:1159: host = GetWindowTreeHostMus(window); On 2017/02/14 23:31:14, sky wrote: > ...
3 years, 10 months ago (2017-02-15 19:35:05 UTC) #7
sky
https://codereview.chromium.org/2696873002/diff/60001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/60001/ui/aura/mus/window_tree_client.cc#newcode1156 ui/aura/mus/window_tree_client.cc:1156: window = WindowMus::Get(host->window()); If this happens I think you ...
3 years, 10 months ago (2017-02-15 21:16:39 UTC) #9
riajiang
https://codereview.chromium.org/2696873002/diff/60001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/60001/ui/aura/mus/window_tree_client.cc#newcode1156 ui/aura/mus/window_tree_client.cc:1156: window = WindowMus::Get(host->window()); On 2017/02/15 21:16:39, sky wrote: > ...
3 years, 10 months ago (2017-02-22 23:06:31 UTC) #10
sky
https://codereview.chromium.org/2696873002/diff/80001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/80001/ui/aura/mus/window_tree_client.cc#newcode1143 ui/aura/mus/window_tree_client.cc:1143: DCHECK(host); Remove this DCHECK given the conditional for !host ...
3 years, 10 months ago (2017-02-23 00:56:27 UTC) #15
riajiang
https://codereview.chromium.org/2696873002/diff/80001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/80001/ui/aura/mus/window_tree_client.cc#newcode1143 ui/aura/mus/window_tree_client.cc:1143: DCHECK(host); On 2017/02/23 00:56:27, sky wrote: > Remove this ...
3 years, 10 months ago (2017-02-23 04:06:05 UTC) #16
sadrul
https://codereview.chromium.org/2696873002/diff/100001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/100001/ui/aura/mus/window_tree_client.cc#newcode1135 ui/aura/mus/window_tree_client.cc:1135: } This could be: if (!window) { ... host ...
3 years, 10 months ago (2017-02-23 17:13:00 UTC) #17
riajiang
Made the following changes to the previous patch: 1. Update event root_location in WS after ...
3 years, 9 months ago (2017-03-10 22:42:21 UTC) #21
kylechar
https://codereview.chromium.org/2696873002/diff/180001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/180001/ui/aura/mus/window_tree_client.cc#newcode1842 ui/aura/mus/window_tree_client.cc:1842: WindowTreeHostMus* WindowTreeClient::GetWindowTreeHostMusWithDisplayId( It looks like tonikitoo/fwang have external mode ...
3 years, 9 months ago (2017-03-13 15:08:14 UTC) #22
riajiang
https://codereview.chromium.org/2696873002/diff/180001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/180001/ui/aura/mus/window_tree_client.cc#newcode1842 ui/aura/mus/window_tree_client.cc:1842: WindowTreeHostMus* WindowTreeClient::GetWindowTreeHostMusWithDisplayId( On 2017/03/13 15:08:14, kylechar wrote: > It ...
3 years, 9 months ago (2017-03-13 21:08:27 UTC) #24
sadrul
https://codereview.chromium.org/2696873002/diff/220001/services/ui/ws/test_change_tracker.cc File services/ui/ws/test_change_tracker.cc (right): https://codereview.chromium.org/2696873002/diff/220001/services/ui/ws/test_change_tracker.cc#newcode109 services/ui/ws/test_change_tracker.cc:109: if (change.event_root_location != gfx::Point()) { Use PointF::IsOrigin() instead https://codereview.chromium.org/2696873002/diff/220001/services/ui/ws/test_change_tracker.cc#newcode228 ...
3 years, 9 months ago (2017-03-14 16:08:32 UTC) #25
sadrul
https://codereview.chromium.org/2696873002/diff/220001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/220001/ui/aura/mus/window_tree_client.cc#newcode1140 ui/aura/mus/window_tree_client.cc:1140: WindowMus* window = GetWindowByServerId(window_id); // May be null. Update ...
3 years, 9 months ago (2017-03-14 16:12:17 UTC) #26
riajiang
https://codereview.chromium.org/2696873002/diff/220001/services/ui/ws/test_change_tracker.cc File services/ui/ws/test_change_tracker.cc (right): https://codereview.chromium.org/2696873002/diff/220001/services/ui/ws/test_change_tracker.cc#newcode109 services/ui/ws/test_change_tracker.cc:109: if (change.event_root_location != gfx::Point()) { On 2017/03/14 16:08:32, sadrul ...
3 years, 9 months ago (2017-03-14 19:03:26 UTC) #28
sadrul
Mostly nits. lgtm https://codereview.chromium.org/2696873002/diff/260001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/260001/ui/aura/mus/window_tree_client.cc#newcode169 ui/aura/mus/window_tree_client.cc:169: // the event to in EventProcessor. ...
3 years, 9 months ago (2017-03-15 01:21:17 UTC) #29
riajiang
Hi sky@, could you take a look at services/ui? Thanks! https://codereview.chromium.org/2696873002/diff/260001/ui/aura/mus/window_tree_client.cc File ui/aura/mus/window_tree_client.cc (right): https://codereview.chromium.org/2696873002/diff/260001/ui/aura/mus/window_tree_client.cc#newcode169 ...
3 years, 9 months ago (2017-03-15 15:35:58 UTC) #30
sky
I think we should continue to pass in screen coordinates. To do otherwise means pointer ...
3 years, 9 months ago (2017-03-15 19:20:51 UTC) #31
riajiang
On 2017/03/15 19:20:51, sky wrote: > I think we should continue to pass in screen ...
3 years, 9 months ago (2017-03-15 22:40:56 UTC) #32
sky
On Wed, Mar 15, 2017 at 3:40 PM, <riajiang@chromium.org> wrote: > On 2017/03/15 19:20:51, sky ...
3 years, 9 months ago (2017-03-15 23:44:12 UTC) #33
sadrul
On 2017/03/15 23:44:12, sky wrote: > On Wed, Mar 15, 2017 at 3:40 PM, <mailto:riajiang@chromium.org> ...
3 years, 9 months ago (2017-03-16 01:35:16 UTC) #34
sky
On Wed, Mar 15, 2017 at 6:35 PM, <sadrul@chromium.org> wrote: > On 2017/03/15 23:44:12, sky ...
3 years, 9 months ago (2017-03-16 02:47:07 UTC) #35
sadrul
On 2017/03/16 02:47:07, sky wrote: > On Wed, Mar 15, 2017 at 6:35 PM, <mailto:sadrul@chromium.org> ...
3 years, 9 months ago (2017-03-16 17:25:05 UTC) #36
sky
Prior to Ria's patch the root_location was screen-coordinates. After Ria's patch the root_location is relative ...
3 years, 9 months ago (2017-03-16 20:19:53 UTC) #37
riajiang
But if there's an event occurring at 15,25 (that chrome window is still at 10,20) ...
3 years, 9 months ago (2017-03-16 21:36:52 UTC) #38
sky
The client should have all the information it needs to do this. Chrome knows the ...
3 years, 9 months ago (2017-03-16 21:56:32 UTC) #39
sadrul
Ria and I discussed this offline a little bit, and I have some additional concern: ...
3 years, 9 months ago (2017-03-23 21:07:23 UTC) #40
sky
3 years, 9 months ago (2017-03-23 23:21:51 UTC) #41
SGTM

On Thu, Mar 16, 2017 at 1:19 PM, Scott Violet <sky@chromium.org> wrote:
> Prior to Ria's patch the root_location was screen-coordinates. After
> Ria's patch the root_location is relative to the nearest root of the
> client. For example, lets say you're in chrome and one of Chrome's
> windows is at a location of 10,20 in the root. For an event occurring
> at a location of 5,6 if Chrome gets this event before Ria's change it
> would see 5,6, after Ria's change it sees -5, -14. I would expect it
> to continue seeing 5,6.
>
> I could certainly see making the root_location relative to the display
> it's on, but making it relative to the root seems confusing,
> especially for clients that have multiple roots, in which case how do
> they know which root it was relative to?
>
>   -Scott
>
> On Thu, Mar 16, 2017 at 10:25 AM,  <sadrul@chromium.org> wrote:
>> On 2017/03/16 02:47:07, sky wrote:
>>
>>> On Wed, Mar 15, 2017 at 6:35 PM, <mailto:sadrul@chromium.org> wrote:
>>> > On 2017/03/15 23:44:12, sky wrote:
>>> >> On Wed, Mar 15, 2017 at 3:40 PM, <mailto:riajiang@chromium.org> wrote:
>>> >> > On 2017/03/15 19:20:51, sky wrote:
>>> >> >> I think we should continue to pass in screen coordinates. To do
>>> >> >> otherwise
>>> >> > means
>>> >> >> pointer watcher only events and non-pointer watcher events get
>>> >> >> different
>>> >> >> coordinates, which is confusing.
>>> >> >>
>>> >> >> I'm unclear as to why we need to supply events in the coordinates of
>>> >> >> the
>>> >> >> root
>>> >> > of
>>> >> >> the client's tree. Could you elaborate on why that is necessary?
>>> >> >
>>> >> > I'm not sure I understand the reason why pointer watcher only events
>>> >> > and
>>> >> > non-pointer watcher events would get different coordinates? We are
>>> >> > not
>>> >> > changing
>>> >> > event-location in WS and the change about event-root-location should
>>> >> > apply
>>> >> > to
>>> >> > all located events? Could you explain more about this?
>>> >>
>>> >> Your patch modifies the location of the event and then calls
>>> >> DispatchInputEventToWindowImpl(). DispatchInputEventToWindowImpl() may
>>> >> pass the event to other WS (for point watchers). The location you
>>> >> converted to is specific to a particular window tree, so that if the
>>> >> event is sent to another client the coordinates are unusual. Does that
>>> >> make sense?
>>> >
>>> > I missed this in my review, sorry. Yeah, the conversion needs to happen
>>> > right
>>> > before sending the event to the client. I have left a comment below.
>>> >
>>> >> > For updating event-root-location to be in the coordinates of the root
>>> >> > of
>>> >> > the
>>> >> > client's tree - after we've found the correct window tree that event
>>> >> > is
>>> >> > going to
>>> >> > be sent to in WS, at that point event-root-location is still in the
>>> >> > coordinate
>>> >> > space of the root of the ash window tree, but the correct coordinate
>>> >> > space
>>> >> > for
>>> >> > that event-root-location after we've sent it to WindowTreeClient
>>> >> > would
>>> >> > be
>>> >> > the
>>> >> > root of the window tree that it is going be sent to? In the case of
>>> >> > that
>>> >> > target
>>> >> > window has already been deleted by the time OnWindowInputEvent is
>>> >> > called, we
>>> >> > are
>>> >> > going to use root window as the starting point to look for the next
>>> >> > best
>>> >> > target
>>> >> > window in EventProcessor so that event should be in the root window's
>>> >> > coordinate
>>> >> > space.
>>> >>
>>> >> If the root location is in screen coordinates isn't it converted
>>> > appropriately?
>>> >
>>> > I don't believe so. For example, on other platforms (x11, w32), the
>>> > root-location (and also the location) of a LocatedEvent is set to the
>>> > local
>>> > WTH
>>> > root-windows's coordinate space [1]. And if we want to use local
>>> > targeting,
>>> > we
>>> > need location to be set in the root-window's coord-space.
>>>
>>> By root-window do you mean display-root? I believe Ria's patch was
>>> converting to the connections root, which is not necessarily that of
>>> the display-root.
>>
>> I mean the root of the local window tree, i.e. the 'connections root', and
>> not
>> 'display root'. (local event-targeting happens in the local root's
>> coordinate
>> space).
>>
>>> This would matter for embedded windows.
>>
>> I am not sure what you are referring to here. If you are referring to
>> renderer,
>> then it does expect the location in screen-space, but the browser takes care
>> of
>> computing that from the local window-tree's root coord-space for the rest of
>> the
>> aura platforms [1]. So this should not be a problem there. Are there other
>> embedded windows that would be affected by this?
>
> Currently
>
>>
>> 1:
>>
https://cs.chromium.org/chromium/src/content/browser/renderer_host/render_wid...
>>
>> https://codereview.chromium.org/2696873002/

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698