Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Issue 5254011: Forward unhandled KeyEvents to WidgetGtk's HandleKeyboardEvent() in native textfields. (Closed)

Created:
10 years ago by Zachary Kuznia
Modified:
9 years, 7 months ago
CC:
chromium-reviews, ben+cc_chromium.org, Daniel Erat, Nikita (slow)
Visibility:
Public.

Description

Forward unhandled KeyEvents to WidgetGtk's HandleKeyboardEvent() in native textfields. BUG=chromium-os:6990, chromium-os:9738 TEST=Click on the omnibox's star. Press enter. Check that the bookmark bubble closes. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=69241

Patch Set 1 #

Patch Set 2 : Code Review #

Total comments: 2

Patch Set 3 : Invoke HandleKeyboardEvent from OnKeyEvent() #

Total comments: 2

Patch Set 4 : Re-add activate, add fix for 9738 #

Total comments: 8

Patch Set 5 : Fix nits #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -2 lines) Patch
M views/controls/textfield/native_textfield_gtk.h View 3 1 chunk +4 lines, -0 lines 0 comments Download
M views/controls/textfield/native_textfield_gtk.cc View 1 2 3 4 4 chunks +35 lines, -2 lines 4 comments Download

Messages

Total messages: 22 (0 generated)
Zachary Kuznia
10 years ago (2010-11-30 11:06:40 UTC) #1
oshima
Do we know why hitting return key does not activate accelerator? ctrl-return seems to be ...
10 years ago (2010-11-30 18:44:05 UTC) #2
Zachary Kuznia
On 2010/11/30 18:44:05, oshima wrote: > Do we know why hitting return key does not ...
10 years ago (2010-12-01 09:59:42 UTC) #3
James Su
For this case, handling the "activate" signal should be the most proper way. http://codereview.chromium.org/5254011/diff/2001/views/controls/textfield/native_textfield_gtk.cc File ...
10 years ago (2010-12-01 18:35:55 UTC) #4
oshima
My question was that the accelerator is supposed to capture keyevents before being sent to ...
10 years ago (2010-12-01 20:00:29 UTC) #5
James Su
Please refer to: http://codereview.chromium.org/3046041 In short, handling key events as accelerators before sending them to ...
10 years ago (2010-12-01 20:25:54 UTC) #6
oshima
On Wed, Dec 1, 2010 at 12:25 PM, <suzhe@chromium.org> wrote: > Please refer to: http://codereview.chromium.org/3046041 ...
10 years ago (2010-12-01 21:45:51 UTC) #7
Zachary Kuznia
Updated this change to instead forward key events to WidgetGtk's HandleKeyboardEvent(). Please have another look.
10 years ago (2010-12-02 07:58:03 UTC) #8
James Su
Please make sure that a key event will always be handled by the native widget. ...
10 years ago (2010-12-02 08:37:24 UTC) #9
Zachary Kuznia
Updated the change to fix 9738 as well. Please have another look.
10 years ago (2010-12-15 04:02:47 UTC) #10
James Su
LGTM, except some nits. http://codereview.chromium.org/5254011/diff/18001/views/controls/textfield/native_textfield_gtk.cc File views/controls/textfield/native_textfield_gtk.cc (right): http://codereview.chromium.org/5254011/diff/18001/views/controls/textfield/native_textfield_gtk.cc#newcode376 views/controls/textfield/native_textfield_gtk.cc:376: } No braces. http://codereview.chromium.org/5254011/diff/18001/views/controls/textfield/native_textfield_gtk.cc#newcode390 views/controls/textfield/native_textfield_gtk.cc:390: ...
10 years ago (2010-12-15 06:06:43 UTC) #11
Zachary Kuznia
http://codereview.chromium.org/5254011/diff/18001/views/controls/textfield/native_textfield_gtk.cc File views/controls/textfield/native_textfield_gtk.cc (right): http://codereview.chromium.org/5254011/diff/18001/views/controls/textfield/native_textfield_gtk.cc#newcode376 views/controls/textfield/native_textfield_gtk.cc:376: } On 2010/12/15 06:06:43, James Su wrote: > No ...
10 years ago (2010-12-15 08:23:25 UTC) #12
Dmitry Polukhin
http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc File views/controls/textfield/native_textfield_gtk.cc (right): http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc#newcode440 views/controls/textfield/native_textfield_gtk.cc:440: g_signal_connect_after(widget, "key-press-event", Changing g_signal_connect_after to g_signal_connect basically broke OnKeyPressEvent ...
9 years, 11 months ago (2011-01-17 10:50:19 UTC) #13
James Su
In the future, please CC any CL related to keyboard event handling to me. http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc ...
9 years, 11 months ago (2011-01-17 18:35:16 UTC) #14
Dmitry Polukhin
http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc File views/controls/textfield/native_textfield_gtk.cc (right): http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc#newcode440 views/controls/textfield/native_textfield_gtk.cc:440: g_signal_connect_after(widget, "key-press-event", On 2011/01/17 18:35:16, James Su wrote: > ...
9 years, 11 months ago (2011-01-17 20:10:21 UTC) #15
James Su
http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc File views/controls/textfield/native_textfield_gtk.cc (right): http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc#newcode440 views/controls/textfield/native_textfield_gtk.cc:440: g_signal_connect_after(widget, "key-press-event", On 2011/01/17 20:10:21, Dmitry Polukhin wrote: > ...
9 years, 11 months ago (2011-01-17 21:25:39 UTC) #16
oshima
On Mon, Jan 17, 2011 at 1:25 PM, <suzhe@chromium.org> wrote: > > > http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/native_textfield_gtk.cc > ...
9 years, 11 months ago (2011-01-18 20:19:07 UTC) #17
James Su
On 2011/01/18 20:19:07, oshima wrote: > On Mon, Jan 17, 2011 at 1:25 PM, <mailto:suzhe@chromium.org> ...
9 years, 11 months ago (2011-01-18 20:31:06 UTC) #18
oshima
On Tue, Jan 18, 2011 at 12:31 PM, <suzhe@chromium.org> wrote: > On 2011/01/18 20:19:07, oshima ...
9 years, 11 months ago (2011-01-19 05:20:09 UTC) #19
James Su
在 2011年1月18日 下午9:19,oshima <oshima@chromium.org>写道: > > > On Tue, Jan 18, 2011 at 12:31 PM, ...
9 years, 11 months ago (2011-01-19 05:23:39 UTC) #20
oshima
On Tue, Jan 18, 2011 at 9:23 PM, James Su <suzhe@chromium.org> wrote: > > > ...
9 years, 11 months ago (2011-01-19 20:03:12 UTC) #21
James Su
9 years, 11 months ago (2011-01-19 20:36:34 UTC) #22
在 2011年1月19日 下午12:02,oshima <oshima@chromium.org>写道:

>
>
> On Tue, Jan 18, 2011 at 9:23 PM, James Su <suzhe@chromium.org> wrote:
>
>>
>>
>> 在 2011年1月18日 下午9:19,oshima <oshima@chromium.org>写道:
>>
>>
>>>
>>> On Tue, Jan 18, 2011 at 12:31 PM, <suzhe@chromium.org> wrote:
>>>
>>>> On 2011/01/18 20:19:07, oshima wrote:
>>>>
>>>>  On Mon, Jan 17, 2011 at 1:25 PM, <mailto:suzhe@chromium.org> wrote:
>>>>>
>>>>
>>>>  >
>>>>> >
>>>>> >
>>>>>
>>>>
>>>>
>>>>
http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/na...
>>>>
>>>>> > File views/controls/textfield/native_textfield_gtk.cc (right):
>>>>> >
>>>>> >
>>>>> >
>>>>>
>>>>
>>>>
>>>>
http://codereview.chromium.org/5254011/diff/24001/views/controls/textfield/na...
>>>>
>>>>> > views/controls/textfield/native_textfield_gtk.cc:440:
>>>>> > g_signal_connect_after(widget, "key-press-event",
>>>>> > On 2011/01/17 20:10:21, Dmitry Polukhin wrote:
>>>>> >
>>>>> >> On 2011/01/17 18:35:16, James Su wrote:
>>>>> >> > On 2011/01/17 10:50:19, Dmitry Polukhin wrote:
>>>>> >> > > Changing g_signal_connect_after to g_signal_connect basically
>>>>> >>
>>>>> > broke
>>>>> >
>>>>> >> > > OnKeyPressEvent functionality for edit boxes. Almost no events
>>>>> now
>>>>> >>
>>>>> > delivered
>>>>> >
>>>>> >> > to
>>>>> >> > > OnKeyPressEvent because default processing handles most of them.
>>>>> >>
>>>>> > In
>>>>> >
>>>>> >> particular
>>>>> >> > > I'm fixing
>>>>> >>
>>>>> > http://code.google.com/p/chromium-os/issues/detail?id=10958 that
>>>>> >
>>>>> >> > > happened due to this change. There is another issue
>>>>> >> > > http://code.google.com/p/chromium-os/issues/detail?id=10362.
>>>>> >> > >
>>>>> >> > > I think this change should be reverted to repair OnKeyPressEvent
>>>>> >> > functionality.
>>>>> >> > We should never intercept key events before being handled by the
>>>>> >>
>>>>> > native
>>>>> >
>>>>> >> control.
>>>>> >> > Otherwise the functionalities of the native control and the input
>>>>> >>
>>>>> > method may
>>>>> >
>>>>> >> be
>>>>> >> > broken. For each key event needs intercepting, we need to handle
>>>>> it
>>>>> >>
>>>>> > like what
>>>>> >
>>>>> >> we
>>>>> >> > have done for Enter key in OnAcivateHandler(). For example, we
>>>>> need
>>>>> >>
>>>>> > to handle
>>>>> >
>>>>> >> > arrow keys in "move-cursor" signal handler and Tab key in
>>>>> >>
>>>>> > "move-focus" signal
>>>>> >
>>>>> >> > handler, etc.
>>>>> >>
>>>>> >
>>>>> >  What will happen on Windows? Is it possible to write platform
>>>>> >>
>>>>> > independent code
>>>>> >
>>>>> >> if different events are delivered to handler? Should we remove
>>>>> >>
>>>>> > OnKeyPressEvent
>>>>> >
>>>>> >> because it doesn't work anymore (no events are delivered)?
>>>>> >>
>>>>> > Windows has different event flow, which will always dispatch an key
>>>>> > event to the input method, so things like OnKeyPressEvent and
>>>>> > SkipDefaultKeyEventProcessing work on Windows. But on Linux/Gtk, key
>>>>> > events are dispatched to the input method by the widget itself, so we
>>>>> > may break the input method badly if we intercept key events before
>>>>> the
>>>>> > widget.
>>>>> > So it's impossible for us to the exact same code for these two
>>>>> > platforms. But we can abstract and share at least part of code
>>>>> between
>>>>> > them. Like what we have done in above OnActivate() method, we can use
>>>>> > such kind of trick to deal with the platform difference and put
>>>>> shared
>>>>> > key event handling logic in controller's HandleKeystroke() method.
>>>>> >
>>>>> >
>>>>> > http://codereview.chromium.org/5254011/
>>>>> >
>>>>>
>>>>
>>>>  This is FYI. We're working on gtk less chrome, primarily for touch, but
>>>>> also
>>>>> for future version of chromeos (schedule is TBD).
>>>>> Replacement for chromeos won't happen anytime soon, but hopefully we
>>>>> can
>>>>> address this issue sometime in the future.
>>>>>
>>>>
>>>>  - oshima
>>>>>
>>>>
>>>> Thanks for your information. I noticed that you are working on a native
>>>> textfield implementation based on Views. I'm wondering is there any
>>>> documentation/web site/issue to trace the progress of this effort?
>>>
>>>
>>> No, not really. Is there any specific thing you want to know about?
>>>
>> I'm just wondering how to integrate with input method framework. I'm
>> currently designing and implementing a new input method framework and hope
>> it can replace ibus in the future.
>>
>
>  IME support is currently low priority.  Since we control most of input
> path, we should have more flexibility
> to design it the way we want though (possibly handle IME event before
> sending to textfield, like win?)
>
The only thing I'm concerning is: as IME becomes more and more complicated,
and as input method engines run in separated processes, we probably need to
support calling IME in async mode to avoid blocking the UI process. In other
words, we may need to send a key event to the IME asynchronously and
continue to process the key event until we receive result from the IME. This
change may affect our keyboard event processing flow dramatically.
Btw, Android system is a good example for this kind of async keyboard event
model.


> - oshima
>
>
>
>>
>>
>>>
>>> - oshima
>>>
>>>>
>>>>
>>>>
>>>> http://codereview.chromium.org/5254011/
>>>>
>>>
>>>
>>
>

Powered by Google App Engine
This is Rietveld 408576698