New issue
Advanced search Search tips

Issue 687700 link

Starred by 4 users

Issue metadata

Status: Archived
Owner:
Closed: Mar 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

event dispatching broken in hdpi mash

Project Member Reported by riajiang@chromium.org, Feb 1 2017

Issue description

When running in hdpi mode in mash, event is being sent to the wrong position (x coordinate is correct, y coordinate is off by some offset). This is because we didn't consider device-scale-factor and was using DIP when we convert event location to be in the root window's coordinate (https://cs.chromium.org/chromium/src/ui/aura/mus/window_tree_client.cc?l=1156).

repro: ./chrome --mash --force-device-scale-factor=2

 
Description: Show this description
Description: Show this description
Cc: rjkroege@chromium.org
Summary: event dispatching broken in hdpi mash (was: event dispatching broken for chrome renderer in hdpi mash)
As discussed with sadrul@ offline: This could potentially be fixed by converting event location to DIP in client-lib (https://codereview.chromium.org/2677153003/) or scale the transform and use that to transform the event location (https://codereview.chromium.org/2682443002/). But since what we are doing with events now is - converting event to be in root window's coordinate in client-lib -> transform the event to DIP -> find the target to dispatch the event to (https://cs.chromium.org/chromium/src/ui/events/event_processor.cc?l=31), it seems like we are doing extra work to find the event dispatching target that we just converted from. So one solution would be to skip the converting part in client-lib, still do the transform to DIP in WindowEventDispatcher and then dispatch the event to the window that we received from client-lib before instead of finding the target again. WDYT?
Right. We should skip the targeting phase in aura, since the mus-ws already gives us the target window we should dispatch events to.

Comment 5 by sky@chromium.org, Feb 9 2017

 Issue 686295  has been merged into this issue.
Cc: riajiang@chromium.org
 Issue 690542  has been merged into this issue.
Project Member

Comment 7 by bugdroid1@chromium.org, Feb 9 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/907cde5ee78659803d8eb14736a2a00916c2fa35

commit 907cde5ee78659803d8eb14736a2a00916c2fa35
Author: sky <sky@chromium.org>
Date: Thu Feb 09 23:14:09 2017

chromeos: converts observed pointer events to DIPs

They were in pixels and need to be in dips.

BUG= 687700 
TEST=covered by tests
R=sadrul@chromium.org

Review-Url: https://codereview.chromium.org/2685883003
Cr-Commit-Position: refs/heads/master@{#449453}

[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/content/renderer/mus/renderer_window_tree_client.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/content/renderer/mus/renderer_window_tree_client.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/public/interfaces/window_tree.mojom
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/display.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/test_utils.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/test_utils.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_manager_state.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_manager_state.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_manager_state_unittest.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_server.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_server.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_tree.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_tree.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/services/ui/ws/window_tree_client_unittest.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/ui/aura/mus/window_tree_client.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/ui/aura/mus/window_tree_client.h
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/907cde5ee78659803d8eb14736a2a00916c2fa35/ui/aura/test/mus/window_tree_client_private.cc

Project Member

Comment 8 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6b3d9805494f966193ad47181d39544d541e79f2

commit 6b3d9805494f966193ad47181d39544d541e79f2
Author: riajiang <riajiang@chromium.org>
Date: Thu Feb 23 04:56:31 2017

Avoid two targeting phases in aura client-lib and EventProcessor.

1. Client-lib now skips the step where it converted the event location from
target window's coordinate system to root window's coordinate system; and
sets the target window received from mus-ws to be the target for that event.

2. Added two virtual functions in EventProcessor responsible for getting the
window with the right targeter (either root window or the farthest ancestor
with a targeter set) and for getting the default targeter (WindowTargeter)
respectively.

3. WindowEventDispatcher now is responsible for finding the right target and
doing the conversion between their coordinate systems.

4. WindowTreeHost only sets a targeter for the root window in non-mus mode
so that we don't end up walking all the way up to the root window just to use
the default event targeter.

This also solves the bug where we were using DIP for conversion in the
client-lib but event location was still in pixels at that time.

BUG= 687700 
TEST=aura_unittests
     manual (--force-device-scale-factor=2)

Review-Url: https://codereview.chromium.org/2681613002
Cr-Commit-Position: refs/heads/master@{#452393}

[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/root_window_controller.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/shelf/shelf_widget_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/wm/immersive_fullscreen_controller_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/wm/overview/window_selector_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/wm/panels/panel_layout_manager_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ash/wm/workspace_controller_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/BUILD.gn
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/mus/window_tree_client.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/test/aura_test_helper.cc
[add] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/test/test_window_targeter.cc
[add] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/test/test_window_targeter.h
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/window_event_dispatcher.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/window_event_dispatcher.h
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/window_event_dispatcher_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/aura/window_tree_host.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/events/event_processor.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/events/event_processor.h
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/events/event_processor_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/events/test/test_event_processor.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/events/test/test_event_processor.h
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/views/bubble/bubble_window_targeter_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/views/test/event_generator_delegate_mac.mm
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/views/touchui/touch_selection_controller_impl_unittest.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/views/widget/root_view.cc
[modify] https://crrev.com/6b3d9805494f966193ad47181d39544d541e79f2/ui/views/widget/root_view.h

Project Member

Comment 9 by bugdroid1@chromium.org, Feb 24 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/4e8acf39f19aead0fff12ac584988a29571db65c

commit 4e8acf39f19aead0fff12ac584988a29571db65c
Author: riajiang <riajiang@chromium.org>
Date: Thu Feb 23 23:59:48 2017

Revert of Avoid two targeting phases in aura client-lib and EventProcessor. (patchset #9 id:220001 of https://codereview.chromium.org/2681613002/ )

Reason for revert:
This patch broke window resizing (specifically when making windows bigger and when mouse event location is outside the window bounds for certain distance) in mash. Will fix this before relanding.

Original issue's description:
> Avoid two targeting phases in aura client-lib and EventProcessor.
>
> 1. Client-lib now skips the step where it converted the event location from
> target window's coordinate system to root window's coordinate system; and
> sets the target window received from mus-ws to be the target for that event.
>
> 2. Added two virtual functions in EventProcessor responsible for getting the
> window with the right targeter (either root window or the farthest ancestor
> with a targeter set) and for getting the default targeter (WindowTargeter)
> respectively.
>
> 3. WindowEventDispatcher now is responsible for finding the right target and
> doing the conversion between their coordinate systems.
>
> 4. WindowTreeHost only sets a targeter for the root window in non-mus mode
> so that we don't end up walking all the way up to the root window just to use
> the default event targeter.
>
> This also solves the bug where we were using DIP for conversion in the
> client-lib but event location was still in pixels at that time.
>
> BUG= 687700 
> TEST=aura_unittests
>      manual (--force-device-scale-factor=2)
>
> Review-Url: https://codereview.chromium.org/2681613002
> Cr-Commit-Position: refs/heads/master@{#452393}
> Committed: https://chromium.googlesource.com/chromium/src/+/6b3d9805494f966193ad47181d39544d541e79f2

TBR=sadrul@chromium.org,sky@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 687700 

Review-Url: https://codereview.chromium.org/2715743005
Cr-Commit-Position: refs/heads/master@{#452679}

[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/root_window_controller.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/shelf/shelf_widget_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/wm/immersive_fullscreen_controller_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/wm/overview/window_selector_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/wm/panels/panel_layout_manager_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ash/wm/workspace_controller_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/BUILD.gn
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/mus/window_tree_client.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/test/aura_test_helper.cc
[delete] https://crrev.com/bdfe69d301b8826665a213a553647e26f3b198c1/ui/aura/test/test_window_targeter.cc
[delete] https://crrev.com/bdfe69d301b8826665a213a553647e26f3b198c1/ui/aura/test/test_window_targeter.h
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/window_event_dispatcher.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/window_event_dispatcher.h
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/window_event_dispatcher_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/aura/window_tree_host.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/events/event_processor.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/events/event_processor.h
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/events/event_processor_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/events/test/test_event_processor.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/events/test/test_event_processor.h
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/views/bubble/bubble_window_targeter_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/views/test/event_generator_delegate_mac.mm
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/views/touchui/touch_selection_controller_impl_unittest.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/views/widget/root_view.cc
[modify] https://crrev.com/4e8acf39f19aead0fff12ac584988a29571db65c/ui/views/widget/root_view.h

Project Member

Comment 10 by bugdroid1@chromium.org, Mar 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/762dcf004c4d65c416992d3c6ad4323a9303e9f0

commit 762dcf004c4d65c416992d3c6ad4323a9303e9f0
Author: riajiang <riajiang@chromium.org>
Date: Fri Mar 03 06:23:55 2017

Avoid two targeting phases in aura client-lib and EventProcessor.

1. Client-lib now skips the step where it converted the event location from
target window's coordinate system to root window's coordinate system; and
sets the target window received from mus-ws to be the target for that event.

2. Added two virtual functions in EventProcessor responsible for getting the
window with the right targeter (either root window or the farthest ancestor
with a targeter set) and for getting the default targeter (WindowTargeter)
respectively.

3. WindowEventDispatcher now is responsible for finding the right target and
doing the conversion between their coordinate systems.

4. WindowTreeHost only sets a targeter for the root window in non-mus mode
so that we don't end up walking all the way up to the root window just to use
the default event targeter.

This also solves the bug where we were using DIP for conversion in the
client-lib but event location was still in pixels at that time.

BUG= 687700 
TEST=aura_unittests
     manual (--force-device-scale-factor=2)

Review-Url: https://codereview.chromium.org/2681613002
Cr-Original-Commit-Position: refs/heads/master@{#452393}
Committed: https://chromium.googlesource.com/chromium/src/+/6b3d9805494f966193ad47181d39544d541e79f2
Review-Url: https://codereview.chromium.org/2681613002
Cr-Commit-Position: refs/heads/master@{#454530}

[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/root_window_controller.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/shelf/shelf_widget_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/wm/immersive_fullscreen_controller_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/wm/overview/window_selector_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/wm/panels/panel_layout_manager_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ash/wm/workspace_controller_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/BUILD.gn
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/mus/window_tree_client.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/test/aura_test_helper.cc
[add] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/test/test_window_targeter.cc
[add] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/test/test_window_targeter.h
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/window_event_dispatcher.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/window_event_dispatcher.h
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/window_event_dispatcher_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/window_targeter.h
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/aura/window_tree_host.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/events/event_processor.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/events/event_processor.h
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/events/event_processor_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/events/test/test_event_processor.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/events/test/test_event_processor.h
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/views/bubble/bubble_window_targeter_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/views/test/event_generator_delegate_mac.mm
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/views/touchui/touch_selection_controller_impl_unittest.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/views/widget/root_view.cc
[modify] https://crrev.com/762dcf004c4d65c416992d3c6ad4323a9303e9f0/ui/views/widget/root_view.h

Status: Fixed (was: Started)
Project Member

Comment 12 by bugdroid1@chromium.org, Mar 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d8b7d84c49f08b6e50de6da191264401c074c5a0

commit d8b7d84c49f08b6e50de6da191264401c074c5a0
Author: riajiang <riajiang@chromium.org>
Date: Sat Mar 04 23:08:10 2017

Start with event_target in for loop to avoid GetEventTargeter crash.

Came across this while working on the CL for dispatching event to root
window if target window has already been deleted (
https://codereview.chromium.org/2696873002). If the target window we
are starting from is already the root window in that WindowTreeHost,
starting with the parent target (in this case aura::Env) for that window
would cause crash when trying to access its event targeter. Change it to
start with the event_target itself.

BUG= 687700 ,  664617 
TEST=aura_unittests

Review-Url: https://codereview.chromium.org/2730903005
Cr-Commit-Position: refs/heads/master@{#454780}

[modify] https://crrev.com/d8b7d84c49f08b6e50de6da191264401c074c5a0/ui/aura/mus/window_tree_client_unittest.cc
[modify] https://crrev.com/d8b7d84c49f08b6e50de6da191264401c074c5a0/ui/aura/window_event_dispatcher.cc

Comment 13 by dchan@google.com, May 30 2017

Labels: VerifyIn-60
Labels: VerifyIn-61

Comment 15 by dchan@chromium.org, Jan 22 2018

Status: Archived (was: Fixed)

Sign in to add a comment