[GNC] Gnucash V3.x NSTextInputClient protocol non-compliance

John Ralls jralls at ceridwen.us
Fri Jan 3 00:43:30 EST 2020



> On Jan 2, 2020, at 8:43 PM, KUSUMOTO Norio <kusumoto at na.rim.or.jp> wrote:
> 
> Hi,
> 
> 
>> Please remember to copy the list in all replies.
> 
> I am sorry that my reply is to both an individual and this mailing list. This happened 
> because I didn't realize that the mailing list was not included in the original reply 
> you wrote. This can be confirmed by the fact that your first reply is not included in 
> the mailing list archive. ;-)

Indeed it doesn't. Sorry, I should pay closer attention to my own mail.
> 
> 
>> A long keypress just types the letter when I use the US keyboard. 
> 
> I think this is because the reproduction method was not well conveyed to you 
> because my expression was inappropriate. In particular, my expression of "KEYBOARD" 
> was bad.
> 
> I prepared an image to show that.
> 
> <https://twitter.com/kusumotoukulele/status/1212898597722718208>

No, that wasn't the problem: Windows uses keyboard for that and I understood that you meant the US key layout. I use the option key to select keys and wasn't familiar with the held key method of character selection. I found https://support.apple.com/en-us/HT201586 that explains that it applies only to letters with variations. In western languages that's the vowels plus y, s, l, z, c, and m. My randomly-selected letters to test it weren't on the list so I didn't get it.

> 
> 
>> The Gtk input module is https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-24/modules/input/imquartz.c and it mostly wraps NSTextInputClient. It hasn't been updated in a few years and so it has gotten a little out of sync with Apple's code, but the problem with tab, return, and arrow keys is GnuCash's fault: For the most part I think that the IM works correctly except in the register, but you're a far better judge of that than I am. Does it work the way you expect in dialog boxes?
> 
> Oh! it's not so bad that the text input in the dialog box.
> This is a bright spot for improving Gnucash 3.x. If we can mediate between IM and 
> Gnucash for events, we can improve the situation.
> 
> It was my misunderstanding that the item of the account does not accept the conversion 
> separator by the cursor key. However, I can't do it in dialog boxes.
> 
> The variation input by holding down the 'a' key is also accepted in the text input 
> area of the dialog box, but there is a problem that the original 'a' is left in addition 
> to the selected characters. It seems to me that 'replacementRange' does not work well.
> 

The problems with input everywhere but the register are Gtk imquartz.c problems. Let's work out the register problems first and then we can create an issue at gitlab.gnome.org and work on imquartz.c.

ISTM that the biggest problem is GnuCash grabbing the tab, return, and arrow keys when you're trying to select a character. That strikes me as a keyboard focus problem: The IM's selection window should be getting those key events; the reason is probably that event response in Cocoa is bottom-up and in Gtk (Gdk really) it's top-down: The top-level window gets the event and decides to handle it or pick a child to pass it to. GnuCash's register is grabbing the tab, return, and cursor-key events instead of passing them through. It needs to not do that when the imcontext is active.

Regards,
John Ralls



More information about the gnucash-user mailing list