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

Issue 840209 link

Starred by 4 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 3
Type: Bug
M-X

Blocked on:
issue 840236

Blocking:
issue 873923



Sign in to add a comment

Views Menus + Layered Scrolling: TreeView context menu is offset horizontally in the wrong direction when scrolling (horizontally)

Project Member Reported by tapted@chromium.org, May 7 2018

Issue description

Chrome Version       : 68.0.3422.0
OS Version: OS X 10.13.3

What steps will reproduce the problem?
1. Have a long bookmark folder name
2. Edit any bookmark
3. Scroll horizontally in the bookmark edit dialog and right-click.

What is the expected result?

Context menu should appear under cursor


What happens instead of that?

Context menu is shifted over a whole bunch


 
Screen Shot 2018-05-07 at 11.05.17 am.png
58.7 KB View Download
Interestingly.. the textfield context menu in edit mode is not offset - just the treeview context menu.
Screen Shot 2018-05-07 at 11.15.17 am.png
64.2 KB View Download
Blockedon: 840236
Labels: MacViews-Controls M-69 Target-69
Labels: -Pri-1 Pri-2
Ah, actually this affects both directions, and it's not as bad as I thought.

I think the problem occurs only when the (right) mouse-down also triggers the code in TreeView::SetSelectedNode() that will invoke ScrollRectToVisible() AND scrolling actually needs to occur in that case (in any direction).

View::ProcessMousePressed() does OnMousePressed(event) before showing the context menu. So scrolling occurs first. But when View::ProcessMousePressed() tries to ConvertPointToScreen() it's using the old scroll position -- not the new one.

The problem is probably that the value of event.location() in View::ProcessMousePressed(const ui::MouseEvent& event) effectively needs to change when scrolling occurs (i.e. after the call to OnMousePressed() in ProcessMousePressed()).

I dunno whether that's worth fixing directly, or if TreeView::ShowContextMenu() should just ignore its |Point| argument and instead use display::Screen::GetScreen()->GetCursorScreenPoint() since it is TreeView that invokes ScrollRectToVisible() and is messing with things.
Labels: MacViews-Release
Labels: -MacViews-Release
Labels: -M-69 Group-Menus
Labels: M-69
Labels: -M-69 -Target-69 M-70 Target-70
tapted: Do you plan to work on this?
Blocking: 873923
Cc: tapted@chromium.org
Labels: -Pri-2 -OS-Mac -Target-70 -M-70 M-X OS-Chrome OS-Linux OS-Windows Pri-3
Owner: ----
Status: Available (was: Assigned)
Summary: Views Menus + Layered Scrolling: TreeView context menu is offset horizontally in the wrong direction when scrolling (horizontally) (was: MacViews: TreeView context menu is offset horizontally in the wrong direction when scrolling (horizontally))
So.... this problem actually went away on Mac when we switched back to native context menus \o/.

Either:
 - Those are always anchored to the cursor, or
 - Those are synchronous, so anchor themselves before the ScrollView adjusts its visible rect, rather than after
 - or something else.

But when we roll out layered scrolling to other platforms, this will likely bite again.

Updating labels, and added Issue 873923 to track.

Sign in to add a comment