Summary: | [GTK] Webkit strips accents from some dead-key combinations | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Jaša <jasa.david> | ||||
Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | alp, christian | ||||
Priority: | P2 | Keywords: | Gtk | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | PC | ||||||
OS: | Linux | ||||||
Bug Depends on: | |||||||
Bug Blocks: | 14120 | ||||||
Attachments: |
|
Description
David Jaša
2008-01-25 12:42:46 PST
Pasting such letter to input/textarea works fine. Confirmed. Dead keys are not applied to typed characters whereas typing characters present in the keyboard layout works fine. For instance I cannot use the ^ or ` keys on a German keyboard to input accented characters but umlauts, present as keys, are fine. Christian, are you sure you changed your keyboard layout? The default one for German is "eliminate dead keys", so you should make sure you choose a default US keyboard to test this. (In reply to comment #3) > Christian, are you sure you changed your keyboard layout? The default one for > German is "eliminate dead keys", so you should make sure you choose a default > US keyboard to test this. Yes, I am. I have a German layout with dead keys. Besides, I can type accented letters with '´' or '^' and a vowel virtually everywhere else, such as Gtk, Qt, Gecko widgets, etc. :) My suspicions fall on WebCore/platform/gtk/KeyEventGtk.cpp Might be worth examining singleCharacterString() and other bits. (KeyEventGtk.cpp is one of the ugliest files in the GTK+ port right now. Probably several bugs lurking in there.) (I'm assuming this bug isn't related to input method support.) Created attachment 18990 [details]
Fix
This fix the issue. I tried it with my French Canadian keyboard layout and dead keys (for à,ç,ê,ï,ù...) worked perfectly.
This was totally related to input method. Each key event has to be filtered by gtk_im_context_filter_keypress which will do the magic. At first, my characters were in screwed up: a utf8/utf16 conversion was missing.
While at it, I implemented the isKeypad check and made disambiguateKeyDownEvent behave more like other ports.
Comment on attachment 18990 [details]
Fix
The copy-and-pasted string conversion code looks bogus -- just use String::fromUTF8()?
Added a TODO about refcounting the GdkEvent. We need something like OwnPtr for gdk to do this elegantly.
Looks fine otherwise, though I had to improve the ChangeLog entries.
|