Closed
Bug 951023
Opened 11 years ago
Closed 11 years ago
Gonk widget should set modifier state at dispatching events derived from WidgetInputEvent
Categories
(Core Graveyard :: Widget: Gonk, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla29
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
Attachments
(1 file, 1 obsolete file)
8.60 KB,
patch
|
mwu
:
review+
|
Details | Diff | Splinter Review |
Similar to bug 951021, Gonk widget should set modifier state as far as possible.
Assignee | ||
Comment 1•11 years ago
|
||
I don't test this because I don't have devices which run FxOS.
This patch is similar to bug 951021's patch, therefore, I guess this work well.
tryserver build:
https://tbpl.mozilla.org/?tree=Try&usebuildbot=1&rev=7258700fd945
Attachment #8348508 -
Flags: review?(mwu)
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
Comment on attachment 8348508 [details] [diff] [review]
Patch
>+ event.modifiers = mData.DOMModifiers();
>+ // When dispatching keypress event should cause text input, Alt, Ctrl and
>+ // Meta states must not be set.
>+ // XXX According to Android 4.4's behavior, we might not need to do this.
>+ if (aEventMessage == NS_KEY_PRESS &&
>+ event.charCode && mChar != mUnmodifiedChar) {
>+ event.modifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL | MODIFIER_META);
>+ }
According to nchen's comment at bug 951021 comment 3, this hack isn't necessary on Gonk.
Comment 4•11 years ago
|
||
Comment on attachment 8348508 [details] [diff] [review]
Patch
Review of attachment 8348508 [details] [diff] [review]:
-----------------------------------------------------------------
Mostly makes sense, though we should probably test this before landing.
::: widget/gonk/nsAppShell.cpp
@@ +288,3 @@
> PRUnichar PrintableKeyValue() const;
>
> + int32_t UnModifiedMetaState() const
nit: UnmodifiedMetaState() looks better to me.
@@ +313,2 @@
>
> + if (mKeyCharMap.get()) {
if (!mKeyCharMap.get()) return;
Just have to make sure mChar and mUnmodifiedChar are initialized to some value.
@@ +314,5 @@
> + if (mKeyCharMap.get()) {
> + mChar = mKeyCharMap->getCharacter(mData.key.keyCode, mData.metaState);
> + if (mChar < ' ') {
> + mChar = 0;
> + }
Odd indentation
@@ +338,3 @@
> return 0;
> }
> + if (mChar >= ' ') {
Due to the logic in the KeyEventDispatcher constructor, I think we can just do return mChar ? mChar : mUnmodifiedChar;
Updated•11 years ago
|
Attachment #8348508 -
Flags: review?(mwu)
Assignee | ||
Comment 5•11 years ago
|
||
Sorry, I forgot to post this new patch.
Changes from the previous patch:
* Removing the code of adjusting modifiers for printable keys because I guess it is not necessary on Android 4.x. See comment 3.
* Adding IsControlChar() instead of comparing with ASCII whitespace.
* Removing CharCode() because mChar now stores it.
Attachment #8348508 -
Attachment is obsolete: true
Attachment #8356060 -
Flags: review?(mwu)
Comment 6•11 years ago
|
||
Comment on attachment 8356060 [details] [diff] [review]
Patch
Looks good. If you haven't tested this on a device though, I'll try to test it on a device some time this week.
Attachment #8356060 -
Flags: review?(mwu) → review+
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Michael Wu [:mwu] from comment #6)
> Comment on attachment 8356060 [details] [diff] [review]
> Patch
>
> Looks good. If you haven't tested this on a device though, I'll try to test
> it on a device some time this week.
Yes, I've not tested the patch. I'd like you to test it. Do you want to test it before landing? Or you will test it on landed build and file followup bugs?
Comment 8•11 years ago
|
||
I'll test it before landing, and then mark check-in needed if things look ok.
Assignee | ||
Comment 9•11 years ago
|
||
Okay, thank you for your testing!
Comment 11•11 years ago
|
||
Keywords: checkin-needed
Comment 12•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Updated•6 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•