New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 759856 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

exo: Pointer::OnSurfaceCommit can set hotspot to an incorrect value

Project Member Reported by lpique@chromium.org, Aug 28 2017

Issue description

The Wayland call sequence:

  wl_pointer_set_cursor(..., pointer_surface, hotspot_x, hotspot_y)
  // And then shortly after
  wl_surface_commit(pointer_surface)

ends up ignoring the passed hotspot_x/y values, and instead sets some prior hotspot coordinate.

Both calls end up starting an asynchronous pointer surface snapshot, passing along the hotspot value to use. The first call requests a snapshot with the correct hotspot coordinates. However if the second call is made before the snapshot actually completes, it ends up using whatever  hotspot coordinates where last set by the most recent snapshot that did complete.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Aug 29 2017

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

commit 9f25075ba35f2d463af614fa4d88d632c9f29361
Author: Lloyd Pique <lpique@chromium.org>
Date: Tue Aug 29 18:56:26 2017

exo: Pointer::OnSurfaceCommit() should set the last hotspot

If a call is made to wl_pointer_set_cursor() to set a new surface and
corresponding hotspot, follow shortly thereafter by a call to
wl_surface_commit() to commit changes to the surface to use as the
pointer shape, the hotspot ended up being set to an old hotspot value.

Both calls make an asynchronous call to take a snapshot of the pointer
surface, which takes the hotspot to set. The second call appears to
cause the first snapshot operation to be aborted before completing,
otherwise it would make sense to have the commit call not even set the
hotspot. Instead the call to set the cursor now store the hotspot that
would have been set, and the commit call will use that value. This does
result in the correct hotspot being set.

Bug:  759856 , b:65096873
Change-Id: Iec69b0f138bb81f2da5ea9ecc2b9ff8739b02785
Reviewed-on: https://chromium-review.googlesource.com/639025
Commit-Queue: Lloyd Pique <lpique@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498185}
[modify] https://crrev.com/9f25075ba35f2d463af614fa4d88d632c9f29361/components/exo/pointer.cc
[modify] https://crrev.com/9f25075ba35f2d463af614fa4d88d632c9f29361/components/exo/pointer.h

Comment 2 by lpique@chromium.org, Aug 29 2017

Labels: Merge-Request-61
Project Member

Comment 3 by sheriffbot@chromium.org, Aug 29 2017

Labels: -Merge-Request-61 Merge-Review-61 Hotlist-Merge-Review
This bug requires manual review: Less than 3 days to go before AppStore submit on M61
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), ketakid@(ChromeOS), govind@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 4 by cma...@chromium.org, Aug 29 2017

lpique@, please provide the rationale as to why this change needs to be merged into the release branch. How risky is this and how would the users be impacted if we don't merge this? 

Comment 5 by cma...@chromium.org, Aug 29 2017

Status: Assigned (was: Untriaged)

Comment 6 by lpique@chromium.org, Aug 29 2017

This should be a low risk bug fix, needed as part of solving long-standing issues setting the pointer/mouse cursor in ARC++. It goes along with another non-Chromium change to fix the displayed image.

b/37641315 documents the Android side issue.

The changes impact a Wayland interface primarily used by ARC++, though it would affect any other code that does use the same interface. The code here is only built by default for Chrome OS.

This change fixes an issue with the hotspot set for the cursor, which was obviously wrong after applying the other patch when trying to drag the border of an Android window to resize it.

The other patch is necessary to prevent the cursor from sometimes being invisible in Android apps under certain conditions (most easily reproduced after letting it fade out by not using it for a little while), and I believe the same issue is causing the cursor to appear as a black square at other (much harder to reproduce) times.

We do have an option if we cannot land this change of adding a small workaround in the Android code for 61. But it was a small enough bug fix to the Chromium code that it seemed best to fix there and cherry-pick to 61.

Comment 7 by lpique@chromium.org, Aug 29 2017

Labels: -OS-iOS OS-Chrome
And I just realized this bug was tagged as a iOS bug and not a Chrome OS bug. Sorry!
This change only affects ChromeOS devices running Android apps. Safe merge imo.
Labels: -Merge-Review-61 Merge-Approved-61
Approving merge to M61.
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 31 2017

Labels: -merge-approved-61 merge-merged-3163
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/32e58e42435c2abd48e7ae317bfbbfc2a5eed94d

commit 32e58e42435c2abd48e7ae317bfbbfc2a5eed94d
Author: David Reveman <reveman@chromium.org>
Date: Thu Aug 31 19:44:08 2017

exo: Pointer::OnSurfaceCommit() should set the last hotspot

If a call is made to wl_pointer_set_cursor() to set a new surface and
corresponding hotspot, follow shortly thereafter by a call to
wl_surface_commit() to commit changes to the surface to use as the
pointer shape, the hotspot ended up being set to an old hotspot value.

Both calls make an asynchronous call to take a snapshot of the pointer
surface, which takes the hotspot to set. The second call appears to
cause the first snapshot operation to be aborted before completing,
otherwise it would make sense to have the commit call not even set the
hotspot. Instead the call to set the cursor now store the hotspot that
would have been set, and the commit call will use that value. This does
result in the correct hotspot being set.

TBR=lpique@chromium.org

(cherry picked from commit 9f25075ba35f2d463af614fa4d88d632c9f29361)

Bug:  759856 , b:65096873
Change-Id: Iec69b0f138bb81f2da5ea9ecc2b9ff8739b02785
Reviewed-on: https://chromium-review.googlesource.com/639025
Commit-Queue: Lloyd Pique <lpique@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#498185}
Reviewed-on: https://chromium-review.googlesource.com/644139
Cr-Commit-Position: refs/branch-heads/3163@{#1039}
Cr-Branched-From: ff259bab28b35d242e10186cd63af7ed404fae0d-refs/heads/master@{#488528}
[modify] https://crrev.com/32e58e42435c2abd48e7ae317bfbbfc2a5eed94d/components/exo/pointer.cc
[modify] https://crrev.com/32e58e42435c2abd48e7ae317bfbbfc2a5eed94d/components/exo/pointer.h

Status: Fixed (was: Assigned)

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

Status: Archived (was: Fixed)

Comment 13 by dchan@chromium.org, Jan 23 2018

Status: Fixed (was: Archived)

Sign in to add a comment