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 618434 - Decimal separator is always '.' when using the keypad
Decimal separator is always '.' when using the keypad
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Register
git-master
Other Linux
: Normal normal
: ---
Assigned To: David Hampton
Chris Shoemaker
Depends on:
Blocks:
 
 
Reported: 2010-05-12 10:26 UTC by Geert Janssens
Modified: 2018-06-29 22:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
decimal regression fix patch (2.59 KB, patch)
2010-06-01 05:50 UTC, Yasuaki Taniguchi
committed Details | Review

Description Geert Janssens 2010-05-12 10:26:34 UTC
My locale (nl_BE) uses ',' as the decimal separator character.

When testing r19134 with some real data, I noticed GnuCash no longer enters ',' when using the numeric keypad of my keyboard. Instead it enters a '.'

This is not due to something that changed on my system though, because when I use GnuCash 2.2.9, this still works fine.

I haven't investigated this deeper yet, but perhaps this is related to the register changes in bug #605802 ?
Comment 1 Geert Janssens 2010-05-28 18:57:47 UTC
I have run some tests.

The problem is first introduced in r18713, which is effectively the first revision to start fixing bug 605802 (not counting the the attempt that got reverted).

So I'm pretty sure this issue is introduced as a result of the patches for bug 605802.

I've taken the liberty to add Yasuaki Taniguchi to the cc list of this bug, so he is informed of this problem.
Comment 2 Yasuaki Taniguchi 2010-05-29 03:15:07 UTC
I'd like to know which type of keyboards you use in order to distinguish 
what xkb event is generated when you type ',' key at a numeric keypad.
Because my keyboard (Sun Type 6 US) don't have ',' key in numeric keypad, I can't generate it in my environment right now.

If you are using Linux, the proper names of keyboards are defined in  /usr/share/X11/xkb/keymap/xfree86. Would you tell me which one you use?
Comment 3 Geert Janssens 2010-05-29 07:40:37 UTC
My keyboard is "be" (from Belgian) according to this file. Thank you for taking this up.
Comment 4 Yasuaki Taniguchi 2010-05-29 11:06:57 UTC
I found the Belgian keyboard layout at wikipedia.
  http://en.wikipedia.org/wiki/AZERTY
    Section: Differences between the Belgian and French layouts of the AZERTY keyboard
  http://en.wikipedia.org/wiki/File:Azerty_fr.svg

It seem that the key of decimal is labeled a period, not a comma.
Do you mean a `comma' should be inserted when you press a `period' numeric key? 

According to "be", "latin" and "keypad" files at /usr/share/X11/xkb/symbols/,
KP_Decimal event is generated when a numeric decimal key is pressed.
So I can fix this regression.
Comment 5 Geert Janssens 2010-05-29 11:29:07 UTC
That is correct. There is a '.' printed on the keyboard, but Belgium as several other European countries uses ',' as decimal separator.

I suppose the solution is indeed to output whatever the selected locale's decimal separator symbol is when typing that key on the keypad.

To make things slightly more complicated, most applications on my system type a ',' when in a numeric context and a '.' when in other contexts.

For GnuCash that would mean
* when I am entering a transaction description, the '.' key on my numpad would generate a '.'
* when entering an amount, the same key would generate a ','.

I'm afraid I don't know how that magic works, but it's pretty convenient.
Comment 6 Yasuaki Taniguchi 2010-06-01 05:50:04 UTC
Created attachment 162427 [details] [review]
decimal regression fix patch

This patch fixes this regression.

Gtk's IMContext is not intuitive. In spite of disconnecting IM, gtk's IMContext consumes and convert most of keypress events into single byte string for commitment. So It is necessary to save keyevent before gtk_im_context_filter_keypress(), and restore it after it's commit callback function.

I tested this patch on Linux with LANG=ja,en,nl,de.
I also tested  on Windows with LANG=ja. But I don't test on other language 
environments because I don't have them.
Comment 7 Geert Janssens 2010-06-03 19:57:13 UTC
Review of attachment 162427 [details] [review]:

r19222
Comment 8 John Ralls 2018-06-29 22:39:15 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=618434. Please update any external references or bookmarks.