New issue
Advanced search Search tips

Issue 905035 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Dec 3
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

cross display window dragging is broken with certain layout

Project Member Reported by osh...@chromium.org, Nov 13

Issue description

on ToT:

1) connect external display
2) keep it on the right side of the primary
3) but rotate it to 90 deg
4) drag window from primary to secondary (dragging to right)
   and drag it back to primary without dropping it.

andrewxu@ can you take a look?

 
Cc: osh...@chromium.org
The reason is that in ScreenPositionController::ConvertHostPointToRelativeToRootWindow, it uses the wrong host window for coordinate conversion. |point_in_root| may be not in the display of |root_window|'s host. So it is inappropriate to write the code like https://cs.chromium.org/chromium/src/ash/display/screen_position_controller.cc?sq=package:chromium&g=0&l=30. As result, |location_in_native| (https://cs.chromium.org/chromium/src/ash/display/screen_position_controller.cc?sq=package:chromium&g=0&l=58) is not in any window host's native bounds. 
Project Member

Comment 2 by bugdroid1@chromium.org, Dec 1

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

commit 545c7c017597fb3dc7a4f2c4d121f89f38a0b82e
Author: Andrew Xu <andrewxu@chromium.org>
Date: Sat Dec 01 18:33:48 2018

Fix rounding error in coordinate conversion

Fix the rounding error in code for coordinate conversion from
native host coordinate to screen DIP coordinate.

In the original code, when mouse cursor is in the warp region of
secondary display, its screen DIP coordinate which is computed by
ConvertHostPointToRelativeToRootWindow may be out of secondary display
due to rounding error. It is also found that this rounding error only
happens with specific display zoom factors and display rotation
degrees.

test: ash_unittests

Bug:  905035 
Change-Id: I36af26afe4e210d70b6812a1bddb1a95feb7235f
Reviewed-on: https://chromium-review.googlesource.com/c/1343249
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612923}
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/display/extended_mouse_warp_controller.cc
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/display/extended_mouse_warp_controller.h
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/display/extended_mouse_warp_controller_unittest.cc
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/display/screen_position_controller.cc
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/display/screen_position_controller_unittest.cc
[modify] https://crrev.com/545c7c017597fb3dc7a4f2c4d121f89f38a0b82e/ash/host/ash_window_tree_host_platform.h

Status: Fixed (was: Assigned)
Project Member

Comment 4 by bugdroid1@chromium.org, Dec 5

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

commit beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a
Author: Andrew Xu <andrewxu@chromium.org>
Date: Wed Dec 05 22:44:20 2018

Revert "Fix rounding error in coordinate conversion"

This reverts commit 545c7c017597fb3dc7a4f2c4d121f89f38a0b82e.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> Fix rounding error in coordinate conversion
> 
> Fix the rounding error in code for coordinate conversion from
> native host coordinate to screen DIP coordinate.
> 
> In the original code, when mouse cursor is in the warp region of
> secondary display, its screen DIP coordinate which is computed by
> ConvertHostPointToRelativeToRootWindow may be out of secondary display
> due to rounding error. It is also found that this rounding error only
> happens with specific display zoom factors and display rotation
> degrees.
> 
> test: ash_unittests
> 
> Bug:  905035 
> Change-Id: I36af26afe4e210d70b6812a1bddb1a95feb7235f
> Reviewed-on: https://chromium-review.googlesource.com/c/1343249
> Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
> Commit-Queue: Andrew Xu <andrewxu@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#612923}

TBR=oshima@chromium.org,afakhry@chromium.org,andrewxu@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug:  905035 
Change-Id: I46f3dacd9c293ad4dcc68314969ae8c1127d523d
Reviewed-on: https://chromium-review.googlesource.com/c/1364052
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614145}
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/display/extended_mouse_warp_controller.cc
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/display/extended_mouse_warp_controller.h
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/display/extended_mouse_warp_controller_unittest.cc
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/display/screen_position_controller.cc
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/display/screen_position_controller_unittest.cc
[modify] https://crrev.com/beb365125ff96e4b2a80bf9c9b67cf89baf5ab7a/ash/host/ash_window_tree_host_platform.h

Project Member

Comment 5 by bugdroid1@chromium.org, Dec 6

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

commit a6cdb0f015d98d56b2eddcd20624875762ddb6ba
Author: Andrew Xu <andrewxu@chromium.org>
Date: Thu Dec 06 17:56:38 2018

Fix rounding error in coordinate conversion

Fix the rounding error in code for coordinate conversion from
native host coordinate to screen DIP coordinate.

In the original code, when mouse cursor is in the warp region of
secondary display, its screen DIP coordinate which is computed by
ConvertHostPointToRelativeToRootWindow may be out of secondary display
due to rounding error. It is also found that this rounding error only
happens with specific display zoom factors and display rotation
degrees.

Test: ash_unittests

Bug:  905035 
Change-Id: I4570dee911777ad820ede6677f7a3382f5b9a5fc
Reviewed-on: https://chromium-review.googlesource.com/c/1364392
Reviewed-by: Mitsuru Oshima <oshima@chromium.org>
Commit-Queue: Andrew Xu <andrewxu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#614410}
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/display/extended_mouse_warp_controller.cc
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/display/extended_mouse_warp_controller.h
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/display/extended_mouse_warp_controller_unittest.cc
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/display/screen_position_controller.cc
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/display/screen_position_controller_unittest.cc
[modify] https://crrev.com/a6cdb0f015d98d56b2eddcd20624875762ddb6ba/ash/host/ash_window_tree_host_platform.h

Sign in to add a comment