Figure out if key press synthesis is needed on Linux Ozone |
||||
Issue description
services/ui/ws/platform_display_default.cc contains this code in PlatformDisplayDefault::DispatchEvent(). It runs after each event is dispatched to the event sink.
// We want to emulate the WM_CHAR generation behaviour of Windows.
//
// On Linux, we've previously inserted characters by having
// InputMethodAuraLinux take all key down events and send a character event
// to the TextInputClient. This causes a mismatch in code that has to be
// shared between Windows and Linux, including blink code. Now that we're
// trying to have one way of doing things, we need to standardize on and
// emulate Windows character events.
//
// This is equivalent to what we're doing in the current Linux port, but
// done once instead of done multiple times in different places.
if (event->type() == ui::ET_KEY_PRESSED) {
ui::KeyEvent* key_press_event = event->AsKeyEvent();
ui::KeyEvent char_event(key_press_event->GetCharacter(),
key_press_event->key_code(),
key_press_event->flags());
// We don't check that GetCharacter() is equal because changing a key event
// with an accelerator to a character event can change the character, for
// example, from 'M' to '^M'.
DCHECK_EQ(key_press_event->key_code(), char_event.key_code());
DCHECK_EQ(key_press_event->flags(), char_event.flags());
SendEventToSink(&char_event);
}
This results in two ui::ET_KEYPRESSED events for each letter typed. On Chrome OS it causes issue 706574 , tab moving focus by 2 items. The code isn't necessary on Chrome OS -- the ordinary dispatch works fine. I'm removing it for Chrome OS.
Code was added in https://codereview.chromium.org/1234623004
It's not clear to me or erg@ if this will be needed on Linux Ozone. If not, the code could be removed entirely.
,
Mar 30 2017
Sadrul, should I just nuke that code then?
,
Mar 31 2017
FYI for tonikitoo, I think this code isn't needed anymore, so I'm going to delete it. I tried to manually test Linux Ozone, but it seems to be crashing on startup right now. If you see the keyboard stop working with web content on Linux Ozone, this CL might be why: https://codereview.chromium.org/2795503002
,
Apr 1 2017
Hi james, thanks for looping me in. We are working linux/ozone (x11/wayland) out off trunk for the past 2 weeks - see a quick status in https://www.youtube.com/watch?v=w0IQ6N781iQ - rebasing weekly. As it stabilizes (we still need to get popups / menus properly working), we will proceed with upstreaming it. For the record, feel free to nuke this code out, if it causes ChromeOS problems.
,
Apr 14 2017
,
Apr 14 2017
|
||||
►
Sign in to add a comment |
||||
Comment 1 by sadrul@chromium.org
, Mar 30 2017