Bug 17009 - [GTK] Webkit strips accents from some dead-key combinations
Summary: [GTK] Webkit strips accents from some dead-key combinations
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks: 14120
  Show dependency treegraph
 
Reported: 2008-01-25 12:42 PST by David Jaša
Modified: 2008-02-08 02:42 PST (History)
2 users (show)

See Also:


Attachments
Fix (5.65 KB, patch)
2008-02-07 14:43 PST, Pierre-Luc Beaudoin
alp: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Jaša 2008-01-25 12:42:46 PST
Some accented character in cs layout can be written only by combining "dead" key followed by base letter. If I try to write e.g. "ï", webkit shows only "d". I can reproduce this for any czech accented letter, including latin1-compatible "á".

Webkit version: SVN 29753
Midori version: 0.0.17
Comment 1 David Jaša 2008-01-25 12:46:50 PST
Pasting such letter to input/textarea works fine.
Comment 2 Christian Dywan 2008-01-25 13:29:28 PST
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.
Comment 3 Sven Herzberg 2008-01-25 14:33:03 PST
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.
Comment 4 Christian Dywan 2008-01-25 20:06:17 PST
(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. :)
Comment 5 Alp Toker 2008-01-27 14:08:22 PST
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.)
Comment 6 Pierre-Luc Beaudoin 2008-02-07 14:43:49 PST
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 7 Alp Toker 2008-02-08 02:34:56 PST
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.
Comment 8 Alp Toker 2008-02-08 02:42:33 PST
Landed in r30090.

Please take a look over the commit when you have a moment.