Closed Bug 672697 Opened 13 years ago Closed 13 years ago

Use nsTextEvent for rendering text coming from QInputMethodEvent.

Categories

(Core Graveyard :: Widget: Qt, defect)

x86
MeeGo
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla8

People

(Reporter: romaxa, Assigned: romaxa)

Details

Attachments

(1 file)

right now we are converting InputMethod text string into QKeyEvent, which is not very good.

I think we should use nsTextEvent for QInputMethod
Assignee: nobody → romaxa
Status: NEW → ASSIGNED
Attachment #547140 - Flags: review?
Attachment #547140 - Flags: review? → review?(jeremias.bosch)
this will break plugin support for keyboard.
Comment on attachment 547140 [details] [diff] [review]
Use nsTextEvent when QInputMethod event has non empty commit string

Review of attachment 547140 [details] [diff] [review]:
-----------------------------------------------------------------

As said, for going i.e. into flash or any other plugin we need to have keyevents. nsTextevents are not working with that.
Attachment #547140 - Flags: review?(jeremias.bosch) → review-
> As said, for going i.e. into flash or any other plugin we need to have
> keyevents. nsTextevents are not working with that.

We don't have keyEvents in QInputMethod mode....
Also same text events (pure unicode string) could happen on another platform.
So I guess it is not good to convert Text events on widget side, when we have nsTextEvents...
I think it should be better to handle QInputMethod events as nsTextEvents, and do Text->Key conversion only where it is needed (X-plugins for example).
With current implementation we also don't have proper key events, also in some cases we are keeping only first character of "commitString" and killing the rest
http://mxr.mozilla.org/mozilla-central/source/widget/src/qt/nsWindow.cpp#1593

so as result we are doing dark Magic instead of just sending Text as it is into DOM...

For plugins we can do Text->XSym mapping right before sending event to desktop-plugin,
for Maemo6 we can do quick hack and post QKey and QInputMethod - Events directly to plugin-process main loop:
see https://bugzilla.mozilla.org/show_bug.cgi?id=672857
Comment on attachment 547140 [details] [diff] [review]
Use nsTextEvent when QInputMethod event has non empty commit string

So any other comments?
Attachment #547140 - Flags: review- → review?(jeremias.bosch)
I got some strange (prefilled) text fields on websites - which i still need to compare with the same fennec version without the patch.

Also selection of text and putting the courser in textfields seems to way more complicated than it used to be. Also here i need to compare versions.

Basic Textinput seems to work. 

Error Correction and such needs still to be tested.

It will take another 2-3 days in order to finish testcases.
Comment on attachment 547140 [details] [diff] [review]
Use nsTextEvent when QInputMethod event has non empty commit string

Review of attachment 547140 [details] [diff] [review]:
-----------------------------------------------------------------

I tried with swipe keyboard and error correct provided through this. The issue is that the text (preedit and not commited text) is already commited to fennec. This cause that the preedited and not yet valid text does not get removed when the user select the correct word. You should correctly implement the preedit / commit states of nsTextEvent.
Attachment #547140 - Flags: review?(jeremias.bosch) → review-
You may want to learn from https://bugzilla.mozilla.org/show_bug.cgi?id=583286 this does at least something (but it never worked well)
> I tried with swipe keyboard and error correct provided through this. The
> issue is that the text (preedit and not commited text) is already commited
> to fennec. This cause that the preedited and not yet valid text does not get
wait does it work with current implementation? I did not get any preedit stuff working with current implementation, so I don't see what I'm breaking here...

could you provide steps exactly how to reproduce case which I'm breaking?
Comment on attachment 547140 [details] [diff] [review]
Use nsTextEvent when QInputMethod event has non empty commit string

Review of attachment 547140 [details] [diff] [review]:
-----------------------------------------------------------------

Actually after more testing I conclude that the code is fine. The issue is within swype not your code.
Attachment #547140 - Flags: review- → review+
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/60617a76c65c
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Actually, this got pushed to mozilla-inbound, too.  It'll make the merge fun.  :(
Keywords: checkin-needed
http://hg.mozilla.org/mozilla-central/rev/a59a63155ea8

hm, the merge didn't show anything special, should I be scared? Looking at the file in central, everything looks correct.
Target Milestone: --- → mozilla8
I think hg merge detect correctly changes which are the same...
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: