Views Menus + Layered Scrolling: TreeView context menu is offset horizontally in the wrong direction when scrolling (horizontally) |
||||||||||
Issue descriptionChrome 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
,
May 7 2018
,
May 7 2018
,
May 9 2018
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.
,
Jun 22 2018
,
Jul 2
,
Jul 12
,
Jul 12
,
Aug 13
tapted: Do you plan to work on this?
,
Aug 14
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 |
||||||||||
Comment 1 by tapted@chromium.org
, May 7 201864.2 KB
64.2 KB View Download