After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 550676 - Memory leak, update keyboard layout data structure
Memory leak, update keyboard layout data structure
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Input Methods
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Simos Xenitellis
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-09-03 14:50 UTC by Simos Xenitellis
Modified: 2008-09-10 18:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Updates gtkimcontextsimple.c, gtkimcontextsimpleseqs.h (35.97 KB, patch)
2008-09-03 14:51 UTC, Simos Xenitellis
accepted-commit_now Details | Review
Adds six more keysyms, in sync now with upstream. (596 bytes, patch)
2008-09-08 03:36 UTC, Simos Xenitellis
none Details | Review
Updated patch, fixes leak, simplifies check_algorithmic (9.53 KB, patch)
2008-09-08 03:43 UTC, Simos Xenitellis
none Details | Review
Updated gtkimcontextsimpleseqs.h (27.39 KB, patch)
2008-09-08 03:45 UTC, Simos Xenitellis
none Details | Review
Updated patch, fixes leak, simplifies check_algorithmic (8.84 KB, patch)
2008-09-08 18:43 UTC, Simos Xenitellis
committed Details | Review
Updated gtkimcontextsimpleseqs.h (now 22 variations to first column) (29.02 KB, patch)
2008-09-08 18:45 UTC, Simos Xenitellis
committed Details | Review
Updates gtk/compose-parse.py, deals better with polytonic mess. (4.57 KB, patch)
2008-09-08 18:47 UTC, Simos Xenitellis
committed Details | Review

Description Simos Xenitellis 2008-09-03 14:50:04 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).
Comment 1 Simos Xenitellis 2008-09-03 14:51:32 UTC
Created attachment 117941 [details] [review]
Updates gtkimcontextsimple.c, gtkimcontextsimpleseqs.h
Comment 2 Matthias Clasen 2008-09-03 15:25:46 UTC
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...
Comment 3 Matthias Clasen 2008-09-07 02:45:49 UTC
Simos, the gdkkeysyms.h part of the patch seems to be missing ?
Comment 4 Simos Xenitellis 2008-09-08 03:36:16 UTC
Created attachment 118271 [details] [review]
Adds six more keysyms, in sync now with upstream.
Comment 5 Simos Xenitellis 2008-09-08 03:43:11 UTC
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).
Comment 6 Simos Xenitellis 2008-09-08 03:45:45 UTC
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.).
Comment 7 Matthias Clasen 2008-09-08 03:47:19 UTC
Since the keysym additions are technically new api, we should probably hold off until we've branched off a stable branch.
Comment 8 Simos Xenitellis 2008-09-08 03:51:52 UTC
(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.
Comment 9 Simos Xenitellis 2008-09-08 18:43:59 UTC
Created attachment 118317 [details] [review]
Updated patch, fixes leak, simplifies check_algorithmic
Comment 10 Simos Xenitellis 2008-09-08 18:45:55 UTC
Created attachment 118318 [details] [review]
Updated gtkimcontextsimpleseqs.h (now 22 variations to first column)
Comment 11 Simos Xenitellis 2008-09-08 18:47:30 UTC
Created attachment 118319 [details] [review]
Updates gtk/compose-parse.py, deals better with polytonic mess.
Comment 12 Simos Xenitellis 2008-09-08 18:54:35 UTC
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.
Comment 13 Simos Xenitellis 2008-09-10 14:09:03 UTC
Friendly ping on this report.

Is this patch going to make it to the current stable version on GTK+?
Comment 14 Matthias Clasen 2008-09-10 14:23:18 UTC
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
Comment 15 Simos Xenitellis 2008-09-10 14:51:50 UTC
(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?
Comment 16 Matthias Clasen 2008-09-10 15:12:55 UTC
In that case, sure, apply to trunk.
Comment 17 Simos Xenitellis 2008-09-10 18:05:48 UTC
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.