Commit 6d2a7ddb authored by Yuichiro Hanada's avatar Yuichiro Hanada Committed by Commit Bot

Mark the key repeat events as handled in exo::Keyboard::OnKeyEvent().

Clients of exo expects to handle the key repeat in the client side
according to crrev.com/c/1079768.
Therefore, exo::Keyboard silently ignores the key repeat events.
However, it doesn't mark the key repeat events as handled and
they are used to invoke the accelerators.
This CL changes exo::Keyboard to mark the key repeat events as handled,
then they are not used to invoke the accelerators anymore.

Bug: b/149477038
Test: Hold Ctrl and W on an ARC++ app which eats Ctrl-W key event, and
check that the app doesn't close.

Change-Id: Iab480b94b98ea8d3e12ce67b810162f1f671e3b0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091328Reviewed-by: default avatarMitsuru Oshima <oshima@chromium.org>
Commit-Queue: Yuichiro Hanada <yhanada@chromium.org>
Cr-Commit-Position: refs/heads/master@{#748134}
parent dc746e10
...@@ -243,10 +243,6 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) { ...@@ -243,10 +243,6 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) {
if (!focus_) if (!focus_)
return; return;
// Ignore synthetic key repeat events.
if (event->is_repeat())
return;
// If the event target is not an exo::Surface, let another handler process the // If the event target is not an exo::Surface, let another handler process the
// event. This check may not be necessary once https://crbug.com/624168 is // event. This check may not be necessary once https://crbug.com/624168 is
// resolved. // resolved.
...@@ -255,6 +251,16 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) { ...@@ -255,6 +251,16 @@ void Keyboard::OnKeyEvent(ui::KeyEvent* event) {
return; return;
} }
// Ignore synthetic key repeat events.
if (event->is_repeat()) {
// Clients should not see key repeat events and instead handle them on the
// client side.
// Mark the key repeat events as handled to avoid them from invoking
// accelerators.
event->SetHandled();
return;
}
TRACE_EXO_INPUT_EVENT(event); TRACE_EXO_INPUT_EVENT(event);
// Process reserved accelerators before sending it to client. // Process reserved accelerators before sending it to client.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment