New issue
Advanced search Search tips

Issue 679522 link

Starred by 0 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 672343


Participants' hotlists:
MacViews-Task-Queue


Sign in to add a comment

MacViews: Accelerator handling is done after View::OnKeyPressed.

Project Member Reported by karandeepb@chromium.org, Jan 9 2017

Issue description

Chrome Version: 55.0.2883.95
OS: Mac

On MacViews, accelerator handling is being done after View::OnKeyPressed on the focused view, while the reverse is true on Windows and Linux. This can potentially lead to subtle bugs.
 

Comment 1 by tapted@chromium.org, Jan 25 2017

Blocking: 672343
Labels: MacViews-Controls
Ctrl+Enter does not work in find_bar_view due to this issue on MacViews. Is the order can be changed on MacViews ?
I think we can change the order in BridgedNativeWidget::DispatchKeyEventPostIME() so that FocusManager::OnKeyEvent() called ahead of Widget::OnKeyEvent().
Which one will be better? Changing BridgedNativeWidget::DispatchKeyEventPostIME() to match the order to other platforms or changing FindBarView::HandleKeyEvent() to fix just the Ctrl+Enter action ?

Comment 5 by tapted@chromium.org, Sep 15 2017

swapping in BridgedNativeWidget::DispatchKeyEventPostIME() sgtm. ideally, this needs a cross-platform test that verifies the order on aura and mac is the same.

(some explanation of how the path happens in Aura would be good too - it's complicated :/

E.g.,

"In aura FocusManager::OnKeyEvent() is called via {something - is it WindowEventDispatcher::PreDispatchKeyEvent()? } which happens before the call to Widget::OnKeyEvent() is invoked via EventDispatcher::DispatchEvent()."
In Aura, FocusManager::OnKeyEvent() is called 3 times before View::OnKeyEvent() and 1 times after View::OnKeyEvent().

3 times before View::OnKeyEvent() comes from EventDispatcher::ProcessEvent(), where DispatchEventToEventHandlers() is called 2 times, and DispatchEvent() is called 1 time.
Aura uses WindowEventDispacher in WindowTreeHost::DispatchKeyEventPostIME() while MacViews uses Widget::OnKeyEvent() in BridgedNativeWidget::DispatchKeyEventPostIME().
Project Member

Comment 7 by bugdroid1@chromium.org, Sep 21 2017

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

commit ad6955df7d777df5951ff9e55db6f0ffcd4751f0
Author: jongkwon.lee <jongkwon.lee@navercorp.com>
Date: Thu Sep 21 06:27:41 2017

MacViews: Change the order of OnKeyEvent() in DispatchKeyEventPostIME()

In Aura, FocusManager::OnKeyEvent() is called before
View::OnKeyEvent(). This makes accelerator handling occur before
View's OnKeyPressed() handling. This patch makes the same order
in MacViews and fixes FindInPageTest.CtrlEnter.

Bug:  679522 
Test: interactive_ui_tests FindInPageTest.CtrlEnter
Change-Id: I68d611d7978bfd6e590e957fe2d8c30c117a7944
Reviewed-on: https://chromium-review.googlesource.com/670764
Reviewed-by: Trent Apted <tapted@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#503368}
[modify] https://crrev.com/ad6955df7d777df5951ff9e55db6f0ffcd4751f0/ui/views/cocoa/bridged_native_widget.mm

Comment 8 by tapted@chromium.org, Sep 22 2017

Cc: jongkwon...@navercorp.com
Status: Fixed (was: Available)
FindInPageTest.CtrlEnter passing in https://uberchromegw.corp.google.com/i/chromium.fyi/builders/Chromium%20Mac%2010.10%20MacViews/builds/27735 \o/

Thanks!

Sign in to add a comment