GNOME Bugzilla – Bug 550676
Memory leak, update keyboard layout data structure
Last modified: 2008-09-10 18:05:48 UTC
I attach a patch that 1. solves some cases of memory leaks (now g_free() every time pointers returned from g_ucs4_to_utf8()) 2. simplifies check_algorithmically(); takes code out, creates function check_normalize_nfc(), which does the check whether the current compose sequence can be assigned to a single Unicode character. 3. Updates the list of the compose sequences; adds 7 more dead keys, sorts the list by Unicode value. 4. Updates gtkimcontextsimpleseqs.h with upstream. Verified with gb layout (10 dead keys), gr layout (9 dead keys).
Created attachment 117941 [details] [review] Updates gtkimcontextsimple.c, gtkimcontextsimpleseqs.h
Looks fine to me after a quick look. I'm currently starting to distcheck 2.14.0, lets hold this patch until that is out, since it is somewhat large...
Simos, the gdkkeysyms.h part of the patch seems to be missing ?
Created attachment 118271 [details] [review] Adds six more keysyms, in sync now with upstream.
Created attachment 118272 [details] [review] Updated patch, fixes leak, simplifies check_algorithmic Requires gtkimcontextsimpleseqs.h patch to be applied as well. Detailed description: * Adds check_normalize_nfc function. * Updates check_algorithmic big switch() statement * Covers typo where dead_dasia was given an invalid value; that value is not used in xorg anymore, that we add for those cases were an old Xorg (2008) is used. * Covers issue with dead_tilde, that is used for dead_perispomeni as well. We detect and change sequence in place. * Reorders so that check_algorithmic() checks first, then check_compact_table(). This helps to counter obsolete compose sequences in Compose (upstream).
Created attachment 118273 [details] [review] Updated gtkimcontextsimpleseqs.h In sync with upstream. (Removal of obsolete sequences due to changes in check_algorithmic(), adds cedilla sequences from upstream.).
Since the keysym additions are technically new api, we should probably hold off until we've branched off a stable branch.
(In reply to comment #7) > Since the keysym additions are technically new api, we should probably hold off > until we've branched off a stable branch. > OK, I'll submit updated patches.
Created attachment 118317 [details] [review] Updated patch, fixes leak, simplifies check_algorithmic
Created attachment 118318 [details] [review] Updated gtkimcontextsimpleseqs.h (now 22 variations to first column)
Created attachment 118319 [details] [review] Updates gtk/compose-parse.py, deals better with polytonic mess.
So it's these three patches. Latin was tested to work well, Greek Polytonic was tested as well. Also tested several random compose sequences that involve the Compose key. Greek Polytonic should work with either keysym value for dead_dasia (0xfe65 or 0xfe66) the X server decides to ship.
Friendly ping on this report. Is this patch going to make it to the current stable version on GTK+?
Does the second patch still require new keysyms ? if it does, it has to wait for 2.15, or you have to produce a version that doesn't
(In reply to comment #14) > Does the second patch still require new keysyms ? if it does, it has to wait > for 2.15, or you have to produce a version that doesn't > The second patch does not require new keysyms. Do I apply to trunk?
In that case, sure, apply to trunk.
Committed to trunk. 2008-09-10 Simos Xenitellis <simos@gnome.org> Bug 550676 – Memory leak, update keyboard layout data structure * gtk/gtkimcontextsimple.c (check_normalize_nfc): Added function that checks if unicode sequence can be normalised (NFC) to single character. Fixed memory leaks. (check_algorithmically): Moved code to check_normalize_nfc, updated switch statement for dead keys. (gtk_im_context_simple_filter_keypress): Changed order; first check_algorithmically() is attempted, then check_compact_table(). * gtk/gtkimcontextsimpleseqs.c: Updated compose sequence table gtk_compose_seqs_compac[]. * gtk/compose-parse.py: Updated compose table generation script, matches output to gtk/gtkimcontextsimpleseqs.c.