Closed
Bug 912951
Opened 11 years ago
Closed 11 years ago
supportsSwitching API should return the real value
Categories
(Firefox OS Graveyard :: Gaia::Keyboard, defect)
Tracking
(blocking-b2g:koi+, b2g-v1.2 fixed)
Tracking | Status | |
---|---|---|
b2g-v1.2 | --- | fixed |
People
(Reporter: rudyl, Assigned: janjongboom)
References
Details
(Whiteboard: [ft:system-platform])
Attachments
(2 files, 3 obsolete files)
46 bytes,
patch
|
rudyl
:
review+
kgrandon
:
feedback+
|
Details | Diff | Splinter Review |
7.15 KB,
patch
|
janjongboom
:
review+
|
Details | Diff | Splinter Review |
This is a follow-up bug for Bug 885692.
Right now, we have InputMethodManager::supportsSwitching(), but right now it would always return true.
We would nee to make it reflect the actual value, such as "false" when there is only one layout enabled.
Assignee | ||
Comment 1•11 years ago
|
||
hmm, at the moment this info lives in keyboard_manager, not in Gecko. Should we do some chrome event wizardry to ask the keyboard manager? Or move logic into Gecko? I think I'd like to have it in Gaia but don't know what others think.
You can give the bug to me btw when we have clearance.
Updated•11 years ago
|
Blocks: 910713, keyboard-api
Comment 2•11 years ago
|
||
To resolve the bug, the InputMethod API of gecko needs a way to get the number of enabled keyboard layouts from gaia.
As I said in Bug 910713 comment2, one possible solution is:
Make gaia send a mozContent event to notify gecko when the keyboard layout number has changed.
Reporter | ||
Comment 3•11 years ago
|
||
(In reply to Yuan Xulei [:yxl] from comment #2)
> To resolve the bug, the InputMethod API of gecko needs a way to get the
> number of enabled keyboard layouts from gaia.
>
> As I said in Bug 910713 comment2, one possible solution is:
>
> Make gaia send a mozContent event to notify gecko when the keyboard layout
> number has changed.
Yes, I think this is the way to go.
Jan, can you help on this?
Or I'll take a look at how to implement this.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → janjongboom
Reporter | ||
Updated•11 years ago
|
Whiteboard: [ft:system-platform]
Assignee | ||
Comment 4•11 years ago
|
||
f? for kgrandon for the desktop helper part.
Attachment #801604 -
Flags: review?(rlu)
Attachment #801604 -
Flags: feedback?(kgrandon)
Assignee | ||
Comment 5•11 years ago
|
||
Please note that this bug depends on bug 906096 landing.
Attachment #801606 -
Flags: review?(xyuan)
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #801606 -
Attachment is obsolete: true
Attachment #801606 -
Flags: review?(xyuan)
Attachment #801611 -
Flags: review?(xyuan)
Comment 7•11 years ago
|
||
Comment on attachment 801604 [details] [diff] [review]
Gaia patch
Without too much context, this makes sense to me. Thanks for the flag!
Attachment #801604 -
Flags: feedback?(kgrandon) → feedback+
Comment 8•11 years ago
|
||
Comment on attachment 801606 [details] [diff] [review]
Gecko patch
Review of attachment 801606 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/chrome/content/shell.js
@@ +719,5 @@
> let listener = this._listeners[uid];
> if (!listener)
> return;
>
> + dump('\n\n\n!!!!!\n\n\nALERTSHELPER HANDLEEVENT\n')
Remove the log for debugging only.
::: dom/inputmethod/MozKeyboard.js
@@ +286,5 @@
> Services.obs.addObserver(this, "inner-window-destroyed", false);
> cpmm.addMessageListener('Keyboard:FocusChange', this);
> cpmm.addMessageListener('Keyboard:SelectionChange', this);
> cpmm.addMessageListener('Keyboard:GetContext:Result:OK', this);
> + cpmm.addMessageListener('Keyboard:Layouts', this);
I think a message name of `Keyboard:LayoutsUpdate` or `Keyboard:LayoutsChange' is more consistent and accurate.
@@ +361,5 @@
>
> if (data) {
> + this._mgmt._supportsSwitching = this._layouts[data.type] ?
> + this._layouts[data.type] > 1 :
> + false;
If inputcontext is null, switching keyboard is not allowed. So we need to set _supportsSwiching to false.
Also you need to check if |this._layouts| isn't null before using it.
Attachment #801606 -
Flags: review-
Comment 9•11 years ago
|
||
Comment on attachment 801611 [details] [diff] [review]
Gecko patch
Review of attachment 801611 [details] [diff] [review]:
-----------------------------------------------------------------
Please addressed the above comments.
::: dom/inputmethod/MozKeyboard.js
@@ +359,5 @@
> this._inputcontext = null;
> }
>
> if (data) {
> + this._mgmt._supportsSwitching = this._layouts[data.type] ?
I made a mistake you don't need to check if this._layouts is null here, as it won't be null.
Attachment #801611 -
Flags: review?(xyuan) → review-
Assignee | ||
Comment 10•11 years ago
|
||
Attachment #801611 -
Attachment is obsolete: true
Attachment #802190 -
Flags: review?(xyuan)
Assignee | ||
Comment 11•11 years ago
|
||
(In reply to Yuan Xulei [:yxl] from comment #8)
> Remove the log for debugging only.
Yeah already was removed, you checked the obsoleted patch :-)
> I think a message name of `Keyboard:LayoutsUpdate` or
> `Keyboard:LayoutsChange' is more consistent and accurate.
Changed to LayoutsChange
> If inputcontext is null, switching keyboard is not allowed. So we need to
> set _supportsSwiching to false.
Done
Comment 12•11 years ago
|
||
Comment on attachment 802190 [details] [diff] [review]
Gecko patch v2
r=me.
Attachment #802190 -
Flags: review?(xyuan) → review+
Assignee | ||
Comment 13•11 years ago
|
||
Thanks Yuan. And another patch in queue waiting for bug 906096 :p
Reporter | ||
Comment 14•11 years ago
|
||
Comment on attachment 801604 [details] [diff] [review]
Gaia patch
Looks good to me.
Jan,
Thanks for working on this.
Attachment #801604 -
Flags: review?(rlu) → review+
Comment 15•11 years ago
|
||
(In reply to Jan Jongboom [:janjongboom] from comment #13)
> Thanks Yuan. And another patch in queue waiting for bug 906096 :p
I think it is possible to remove the dependence from bug 906096. Don't let many bugs locked. Could you do so? I'll help you with bug 906096.
Assignee | ||
Comment 16•11 years ago
|
||
Yeah, I'll re-apply against mc if you can help me with 906096 :-) anyway, it won't work in FF nightly tho until that one is landed.
Assignee | ||
Comment 17•11 years ago
|
||
Here is the patch rebased against mc.
Attachment #802190 -
Attachment is obsolete: true
Attachment #802957 -
Flags: review+
Assignee | ||
Comment 18•11 years ago
|
||
Try is running @ https://tbpl.mozilla.org/?tree=Try&rev=d586c7611c44
Assignee | ||
Comment 19•11 years ago
|
||
I've updated the gaia patch so it works against current FF Nightly \o/ (copy-paste FTW)
Comment 21•11 years ago
|
||
Gecko: https://hg.mozilla.org/integration/b2g-inbound/rev/9a70b1360b8f
Gaia: https://github.com/mozilla-b2g/gaia/commit/49cdb9bd52c98aa256f31c2acdfd5f41d3ab175e
Keywords: checkin-needed
Comment 22•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.2 FC (16sep)
Assignee | ||
Comment 23•11 years ago
|
||
Thanks Ryan!
Assignee | ||
Comment 24•11 years ago
|
||
Backed out gaia commit because of bug 916028 in https://github.com/mozilla-b2g/gaia/commit/4ad9fb3beafb075367017de4fdc4d85b1b52f8e0
Assignee | ||
Updated•11 years ago
|
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 25•11 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 11 years ago → 11 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 26•11 years ago
|
||
When testing this patch with 910713, I found I could not get it to work on device.
But using FF Nightly is ok.
Error message on Unagi
======================
09-16 17:47:10.761: E/GeckoConsole(1157): [JavaScript Error: "Keyboard is undefined" {file: "chrome://browser/content/shell.js" line: 1075}]
Jan,
Would you see this when testing on device?
Flags: needinfo?(janjongboom)
Assignee | ||
Comment 27•11 years ago
|
||
Hmm, I think that's because I build with 906096 included... We fixed that there... Shall I create a follow up?
Flags: needinfo?(janjongboom)
Assignee | ||
Comment 28•11 years ago
|
||
(/me backporting change and building gecko, let's see if it fixes it)
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Comment 29•11 years ago
|
||
Created bug 916740 as follow up. Sorry, my bad...
Reporter | ||
Comment 30•11 years ago
|
||
Jan,
Thanks for your quick response on this.
I'll give it a try with your patch if I got some free cycles today.
Comment 31•11 years ago
|
||
Merged before branching.
blocking-b2g: koi? → koi+
status-b2g-v1.2:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•